chore: replace dead airbnb eslint stack with eslint 9 flat config, bump stylelint to 17 - #102
Open
kimlimjustin wants to merge 1 commit into
Open
chore: replace dead airbnb eslint stack with eslint 9 flat config, bump stylelint to 17#102kimlimjustin wants to merge 1 commit into
kimlimjustin wants to merge 1 commit into
Conversation
…mp stylelint to 17 The lint stack silently died long ago: there was no eslint config file at all (lint:js errored immediately), and the airbnb preset chain pinned eslint to ^8 while its own peers went unmaintained. Every npm dependabot PR failed on ERESOLVE against this stack. - add eslint.config.mjs (flat config: js + typescript-eslint + react + react-hooks + jsx-a11y + regexp + prettier) - drop eslint-config-airbnb, @kesills/airbnb-typescript, plugin-import, import-resolver-typescript, raw @typescript-eslint/* pair - bump stylelint 15 -> 17, stylelint-config-standard 33 -> 40 - fix all new lint findings: rules-of-hooks violation in BlogPostItem wrapper, setState-in-effect in SimpleVideoPlayer, catch(e: any) narrowing, require() -> ESM image import (+ png/jpg type decls), stylelint autofixes and specificity order - ignore eslint >=10 in dependabot (typescript-eslint ^8 peers eslint ^8.57 || ^9 only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
npm 生态的 dependabot PR(#90 #98 #100 #101 等)全部红了,根因是 lint 栈早已死亡:
lint:js从来跑不起来eslint-config-airbnb@19把 eslint 钉在 ^7||^8,和新版本插件形成 ERESOLVE 死锁改动
eslint.config.mjs(ESLint 9 flat config:js + typescript-eslint + react + react-hooks + jsx-a11y + regexp + prettier)catch (e: any)、require()图片导入改 ESM(补 png/jpg 类型声明)、stylelint 自动修复及选择器顺序验证
npm run lint:js0 error(此前直接报错退出)npm run lint:css0 errornpm run typecheck通过npm run build通过,KaTeX CSS/字体、公众号二维码图片均正常打包对现有 dependabot PR 的影响