-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Build: Migrate ESLint to oxlint for 50-100x faster linting #34170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0c0ab4e
Migrate ESLint to oxlint and move lint tooling to root
kasperpeulen 7a88e94
Fix review issues in oxlint migration
kasperpeulen 41e016e
Recover lost plugins via oxlint jsPlugins
kasperpeulen c8fc6df
Remove 91 stale eslint-disable comments
kasperpeulen 563ac07
Fix issues found in code review
kasperpeulen ae93a73
Simplify oxlint config to minimal necessary rules
kasperpeulen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| if [ -z "$SKIP_STORYBOOK_GIT_HOOKS" ]; then | ||
| cd code | ||
| yarn lint-staged | ||
|
|
||
| cd ../scripts | ||
| yarn lint-staged | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,201 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json", | ||
| "categories": { | ||
| "correctness": "warn" | ||
| }, | ||
| "plugins": ["typescript", "react", "import", "jsx-a11y"], | ||
| "jsPlugins": [ | ||
| "eslint-plugin-storybook", | ||
| "eslint-plugin-playwright", | ||
| { "name": "local-rules", "specifier": "./scripts/eslint-plugin-local-rules" } | ||
| ], | ||
| "settings": { | ||
| "react": { "version": "18" } | ||
| }, | ||
| "rules": { | ||
| "no-unused-vars": "off", | ||
| "no-shadow-restricted-names": "off", | ||
| "no-control-regex": "off", | ||
| "no-sparse-arrays": "off", | ||
| "no-useless-escape": "off", | ||
| "no-nonoctal-decimal-escape": "off", | ||
|
|
||
| "typescript/no-implied-eval": "error", | ||
| "typescript/ban-ts-comment": "error", | ||
| "typescript/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }], | ||
| "typescript/no-explicit-any": "warn", | ||
| "typescript/no-unused-vars": "warn", | ||
| "typescript/no-empty-object-type": "warn", | ||
| "typescript/no-empty-interface": "warn", | ||
| "typescript/no-unsafe-function-type": "warn", | ||
| "typescript/triple-slash-reference": "off", | ||
|
|
||
| "react/jsx-no-undef": "off", | ||
| "react/exhaustive-deps": "off", | ||
|
|
||
| "import/default": "off", | ||
| "import/namespace": "off", | ||
| "import/no-named-as-default": "warn", | ||
| "import/no-named-as-default-member": "warn", | ||
| "import/no-self-import": "warn", | ||
|
|
||
| "jsx-a11y/anchor-has-content": "off", | ||
| "jsx-a11y/prefer-tag-over-role": "off", | ||
|
|
||
| "no-restricted-imports": [ | ||
| "error", | ||
| { | ||
| "paths": [ | ||
| { | ||
| "name": "react-aria", | ||
| "message": "Don't import from react-aria directly, please use the specific submodule like @react-aria/overlays instead", | ||
| "allowTypeImports": false | ||
| }, | ||
| { | ||
| "name": "react-stately", | ||
| "message": "Don't import from react-stately directly, please use the specific submodule like @react-stately/overlays instead", | ||
| "allowTypeImports": false | ||
| }, | ||
| { | ||
| "name": "react-aria-components", | ||
| "message": "Don't import from react-aria-components root, but use the react-aria-components/patched-dist/ComponentX entrypoints which are optimised for tree-shaking.", | ||
| "allowTypeImports": true | ||
| }, | ||
| { | ||
| "name": "es-toolkit", | ||
| "message": "Don't import from es-toolkit root, but use the sub-exports like es-toolkit/array entrypoints instead which are optimised for tree-shaking.", | ||
| "allowTypeImports": true | ||
| }, | ||
| { | ||
| "name": "lodash", | ||
| "message": "lodash is banned. Use es-toolkit or native alternatives." | ||
| }, | ||
| { | ||
| "name": "lodash-es", | ||
| "message": "lodash-es is banned. Use es-toolkit or native alternatives." | ||
| }, | ||
| { "name": "chalk", "message": "chalk is banned. Use picocolors instead." }, | ||
| { "name": "qs", "message": "qs is banned. Use URLSearchParams instead." }, | ||
| { "name": "handlebars", "message": "handlebars is banned." }, | ||
| { "name": "fs-extra", "message": "fs-extra is banned. Use node:fs/promises instead." } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.ts", "**/*.tsx"], | ||
| "rules": { | ||
| "local-rules/no-uncategorized-errors": "warn", | ||
| "local-rules/storybook-monorepo-imports": "error" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/*.test.*", "**/*.spec.*", "**/*.mockdata.*", "**/*.compat.*"], | ||
| "rules": { | ||
| "local-rules/no-uncategorized-errors": "off", | ||
| "local-rules/storybook-monorepo-imports": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["code/core/src/preview-errors.ts"], | ||
| "rules": { | ||
| "local-rules/no-duplicated-error-codes": "error" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/__tests__/**", | ||
| "**/__testfixtures__/**", | ||
| "**/*.test.*", | ||
| "**/*.stories.*", | ||
| "**/template/**/*" | ||
| ], | ||
| "rules": { | ||
| "jsx-a11y/click-events-have-key-events": "off", | ||
| "jsx-a11y/no-static-element-interactions": "off", | ||
| "jsx-a11y/iframe-has-title": "off", | ||
| "jsx-a11y/alt-text": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/*.stories.{ts,tsx,js,jsx,mjs,cjs}", "**/*.story.{ts,tsx,js,jsx,mjs,cjs}"], | ||
| "rules": { | ||
| "storybook/await-interactions": "error", | ||
| "storybook/context-in-play-function": "error", | ||
| "storybook/default-exports": "error", | ||
| "storybook/hierarchy-separator": "warn", | ||
| "storybook/no-redundant-story-name": "warn", | ||
| "storybook/prefer-pascal-case": "warn", | ||
| "storybook/story-exports": "error", | ||
| "storybook/use-storybook-expect": "error", | ||
| "storybook/use-storybook-testing-library": "error" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/core/**/*.stories.*", "**/core/**/*.story.*"], | ||
| "rules": { | ||
| "storybook/use-storybook-expect": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/renderers/**/*.stories.*", "**/core/template/**/*.stories.*"], | ||
| "rules": { | ||
| "storybook/no-renderer-packages": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/*.vue", "**/*.svelte"], | ||
| "rules": { | ||
| "typescript/consistent-type-imports": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/template/**/*"], | ||
| "rules": { | ||
| "no-restricted-imports": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/e2e-tests/*.ts"], | ||
| "rules": { | ||
| "playwright/no-skipped-test": ["warn", { "allowConditional": true }], | ||
| "playwright/prefer-comparison-matcher": "error", | ||
| "playwright/prefer-equality-matcher": "error", | ||
| "playwright/prefer-hooks-on-top": "error", | ||
| "playwright/prefer-strict-equal": "error", | ||
| "playwright/prefer-to-be": "error", | ||
| "playwright/prefer-to-contain": "error", | ||
| "playwright/prefer-to-have-count": "error", | ||
| "playwright/prefer-to-have-length": "error", | ||
| "playwright/require-to-throw-message": "error", | ||
| "playwright/require-top-level-describe": "error" | ||
| } | ||
| } | ||
| ], | ||
| "ignorePatterns": [ | ||
| "**/node_modules", | ||
| "**/dist", | ||
| "**/build", | ||
| "**/coverage", | ||
| "docs", | ||
| "sandbox", | ||
| "repros", | ||
| "test-storybooks", | ||
| "storybook-static", | ||
| "built-storybooks", | ||
| "code/lib/codemod/src/transforms/__testfixtures__", | ||
| "code/core/assets", | ||
| "code/core/report", | ||
| "code/core/src/core-server/utils/__search-files-tests__", | ||
| "code/core/src/core-server/utils/__mockdata__/src/Empty.stories.ts", | ||
| "code/lib/cli-storybook/test", | ||
| "scripts/storage", | ||
| "scripts/repros-generator", | ||
| "*.bundle.js", | ||
| "*.js.map", | ||
| ".yarn", | ||
| ".cache", | ||
| ".nx" | ||
| ] | ||
| } |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep AGENTS lint guidance aligned with the required per-file JS/TS lint workflow.
Line 239 now documents only
yarn lint:fix, which diverges from the required per-file command and can make single-file linting guidance inconsistent.As per coding guidelines: "Lint JavaScript/TypeScript files with
yarn --cwd code lint:js:cmd <file-relative-to-code-folder> --fixbefore submitting changes".🤖 Prompt for AI Agents