-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: use oxlint to speed up lint #10168
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
50a9a3a
build: add eslint-plugin-oxlint dependency
EurFelux 6a87d3c
build(eslint): add oxlint plugin to eslint config
EurFelux 020d8c5
build: add oxlint v1.15.0 as a dependency
EurFelux 26387fe
build: add oxlint to linting commands
EurFelux d4fd8fa
build: add oxlint configuration file
EurFelux 786e797
chore: update oxlint configuration and related settings
EurFelux f29d31d
fix: lint warning
EurFelux e3f87f4
chore: update oxlintrc from eslint.recommended
EurFelux 7f9cab4
refactor(lint): update eslint and oxlint configurations
EurFelux c6935a9
fix: lint error
EurFelux 3a92040
fix(file): replace eslint-disable with oxlint-disable in sanitizeFile…
EurFelux cb81241
fix: enforce stricter linting by failing on warnings in test:lint script
EurFelux ef58b90
feat: add recommended ts-eslint rules into exlint
EurFelux fb89f2c
docs: remove outdated comment in oxlint config file
EurFelux bb8f802
style: disable typescript/no-require-imports rule in oxlint config
EurFelux 89a1236
docs(utils): fix comment typo from NODE to NOTE
EurFelux 0561a3a
fix(MessageErrorBoundary): correct error description display condition
EurFelux a4b0ad8
chore: add oxc-vscode extension to recommended list
EurFelux b6a353a
ci(workflows): reorder format check step in pr-ci.yml
EurFelux e821e04
chore: update yarn.lock
EurFelux c116c16
Merge branch 'main' of github.com:CherryHQ/cherry-studio into chore/o…
EurFelux 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 |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "categories": {}, | ||
| "env": { | ||
| "es2022": true | ||
| }, | ||
| "globals": {}, | ||
| "ignorePatterns": [ | ||
| "node_modules/**", | ||
| "build/**", | ||
| "dist/**", | ||
| "out/**", | ||
| "local/**", | ||
| ".yarn/**", | ||
| ".gitignore", | ||
| "scripts/cloudflare-worker.js", | ||
| "src/main/integration/nutstore/sso/lib/**", | ||
| "src/main/integration/cherryin/index.js", | ||
| "src/main/integration/nutstore/sso/lib/**", | ||
| "src/renderer/src/ui/**", | ||
| "packages/**/dist", | ||
| "eslint.config.mjs" | ||
| ], | ||
| "overrides": [ | ||
| // set different env | ||
| { | ||
| "env": { | ||
| "node": true | ||
| }, | ||
| "files": ["src/main/**", "resources/scripts/**", "scripts/**", "playwright.config.ts", "electron.vite.config.ts"] | ||
| }, | ||
| { | ||
| "env": { | ||
| "browser": true | ||
| }, | ||
| "files": [ | ||
| "src/renderer/**/*.{ts,tsx}", | ||
| "packages/aiCore/**", | ||
| "packages/extension-table-plus/**", | ||
| "resources/js/**" | ||
| ] | ||
| }, | ||
| { | ||
| "env": { | ||
| "node": true, | ||
| "vitest": true | ||
| }, | ||
| "files": ["**/__tests__/*.test.{ts,tsx}", "tests/**"] | ||
| }, | ||
| { | ||
| "env": { | ||
| "browser": true, | ||
| "node": true | ||
| }, | ||
| "files": ["src/preload/**"] | ||
| } | ||
| ], | ||
| // We don't use the React plugin here because its behavior differs slightly from that of ESLint's React plugin. | ||
| "plugins": ["unicorn", "typescript", "oxc", "import"], | ||
| "rules": { | ||
| "constructor-super": "error", | ||
| "for-direction": "error", | ||
| "getter-return": "error", | ||
| "no-array-constructor": "off", | ||
| // "import/no-cycle": "error", // tons of error, bro | ||
| "no-async-promise-executor": "error", | ||
| "no-caller": "warn", | ||
| "no-case-declarations": "error", | ||
| "no-class-assign": "error", | ||
| "no-compare-neg-zero": "error", | ||
| "no-cond-assign": "error", | ||
| "no-const-assign": "error", | ||
| "no-constant-binary-expression": "error", | ||
| "no-constant-condition": "error", | ||
| "no-control-regex": "error", | ||
| "no-debugger": "error", | ||
| "no-delete-var": "error", | ||
| "no-dupe-args": "error", | ||
| "no-dupe-class-members": "error", | ||
| "no-dupe-else-if": "error", | ||
| "no-dupe-keys": "error", | ||
| "no-duplicate-case": "error", | ||
| "no-empty": "error", | ||
| "no-empty-character-class": "error", | ||
| "no-empty-pattern": "error", | ||
| "no-empty-static-block": "error", | ||
| "no-eval": "warn", | ||
| "no-ex-assign": "error", | ||
| "no-extra-boolean-cast": "error", | ||
| "no-fallthrough": "warn", | ||
| "no-func-assign": "error", | ||
| "no-global-assign": "error", | ||
| "no-import-assign": "error", | ||
| "no-invalid-regexp": "error", | ||
| "no-irregular-whitespace": "error", | ||
| "no-loss-of-precision": "error", | ||
| "no-misleading-character-class": "error", | ||
| "no-new-native-nonconstructor": "error", | ||
| "no-nonoctal-decimal-escape": "error", | ||
| "no-obj-calls": "error", | ||
| "no-octal": "error", | ||
| "no-prototype-builtins": "error", | ||
| "no-redeclare": "error", | ||
| "no-regex-spaces": "error", | ||
| "no-self-assign": "error", | ||
| "no-setter-return": "error", | ||
| "no-shadow-restricted-names": "error", | ||
| "no-sparse-arrays": "error", | ||
| "no-this-before-super": "error", | ||
| "no-unassigned-vars": "warn", | ||
| "no-undef": "error", | ||
| "no-unexpected-multiline": "error", | ||
| "no-unreachable": "error", | ||
| "no-unsafe-finally": "error", | ||
| "no-unsafe-negation": "error", | ||
| "no-unsafe-optional-chaining": "error", | ||
| "no-unused-expressions": "off", // this rule disallow us to use expression to call function, like `condition && fn()` | ||
| "no-unused-labels": "error", | ||
| "no-unused-private-class-members": "error", | ||
| "no-unused-vars": ["error", { "caughtErrors": "none" }], | ||
| "no-useless-backreference": "error", | ||
| "no-useless-catch": "error", | ||
| "no-useless-escape": "error", | ||
| "no-useless-rename": "warn", | ||
| "no-with": "error", | ||
| "oxc/bad-array-method-on-arguments": "warn", | ||
| "oxc/bad-char-at-comparison": "warn", | ||
| "oxc/bad-comparison-sequence": "warn", | ||
| "oxc/bad-min-max-func": "warn", | ||
| "oxc/bad-object-literal-comparison": "warn", | ||
| "oxc/bad-replace-all-arg": "warn", | ||
| "oxc/const-comparisons": "warn", | ||
| "oxc/double-comparisons": "warn", | ||
| "oxc/erasing-op": "warn", | ||
| "oxc/missing-throw": "warn", | ||
| "oxc/number-arg-out-of-range": "warn", | ||
| "oxc/only-used-in-recursion": "off", // manually off bacause of existing warning. may turn it on in the future | ||
| "oxc/uninvoked-array-callback": "warn", | ||
| "require-yield": "error", | ||
| "typescript/await-thenable": "warn", | ||
| // "typescript/ban-ts-comment": "error", | ||
| "typescript/no-array-constructor": "error", | ||
| // "typescript/consistent-type-imports": "error", | ||
| "typescript/no-array-delete": "warn", | ||
| "typescript/no-base-to-string": "warn", | ||
| "typescript/no-duplicate-enum-values": "error", | ||
| "typescript/no-duplicate-type-constituents": "warn", | ||
| "typescript/no-empty-object-type": "off", | ||
| "typescript/no-explicit-any": "off", // not safe but too many errors | ||
| "typescript/no-extra-non-null-assertion": "error", | ||
| "typescript/no-floating-promises": "warn", | ||
| "typescript/no-for-in-array": "warn", | ||
| "typescript/no-implied-eval": "warn", | ||
| "typescript/no-meaningless-void-operator": "warn", | ||
| "typescript/no-misused-new": "error", | ||
| "typescript/no-misused-spread": "warn", | ||
| "typescript/no-namespace": "error", | ||
| "typescript/no-non-null-asserted-optional-chain": "off", // it's off now. but may turn it on. | ||
| "typescript/no-redundant-type-constituents": "warn", | ||
| "typescript/no-require-imports": "off", | ||
| "typescript/no-this-alias": "error", | ||
| "typescript/no-unnecessary-parameter-property-assignment": "warn", | ||
| "typescript/no-unnecessary-type-constraint": "error", | ||
| "typescript/no-unsafe-declaration-merging": "error", | ||
| "typescript/no-unsafe-function-type": "error", | ||
| "typescript/no-unsafe-unary-minus": "warn", | ||
| "typescript/no-useless-empty-export": "warn", | ||
| "typescript/no-wrapper-object-types": "error", | ||
| "typescript/prefer-as-const": "error", | ||
| "typescript/prefer-namespace-keyword": "error", | ||
| "typescript/require-array-sort-compare": "warn", | ||
| "typescript/restrict-template-expressions": "warn", | ||
| "typescript/triple-slash-reference": "error", | ||
| "typescript/unbound-method": "warn", | ||
| "unicorn/no-await-in-promise-methods": "warn", | ||
| "unicorn/no-empty-file": "off", // manually off bacause of existing warning. may turn it on in the future | ||
| "unicorn/no-invalid-fetch-options": "warn", | ||
| "unicorn/no-invalid-remove-event-listener": "warn", | ||
| "unicorn/no-new-array": "off", // manually off bacause of existing warning. may turn it on in the future | ||
| "unicorn/no-single-promise-in-promise-methods": "warn", | ||
| "unicorn/no-thenable": "off", // manually off bacause of existing warning. may turn it on in the future | ||
| "unicorn/no-unnecessary-await": "warn", | ||
| "unicorn/no-useless-fallback-in-spread": "warn", | ||
| "unicorn/no-useless-length-check": "warn", | ||
| "unicorn/no-useless-spread": "off", // manually off bacause of existing warning. may turn it on in the future | ||
| "unicorn/prefer-set-size": "warn", | ||
| "unicorn/prefer-string-starts-ends-with": "warn", | ||
| "use-isnan": "error", | ||
| "valid-typeof": "error" | ||
| }, | ||
| "settings": { | ||
| "jsdoc": { | ||
| "augmentsExtendsReplacesDocs": false, | ||
| "exemptDestructuredRootsFromChecks": false, | ||
| "ignoreInternal": false, | ||
| "ignorePrivate": false, | ||
| "ignoreReplacesDocs": true, | ||
| "implementsReplacesDocs": false, | ||
| "overrideReplacesDocs": true, | ||
| "tagNamePreference": {} | ||
| }, | ||
| "jsx-a11y": { | ||
| "attributes": {}, | ||
| "components": {}, | ||
| "polymorphicPropName": null | ||
| }, | ||
| "next": { | ||
| "rootDir": [] | ||
| }, | ||
| "react": { | ||
| "formComponents": [], | ||
| "linkComponents": [] | ||
| } | ||
| } | ||
| } | ||
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
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
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
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
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
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
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.
Looks like 2x issue preventing you from using react plugin.
First being a bug which should be fixed in the next version here: oxc-project/oxc#13815
The second being:
Which i think you should just disable in your oxlint config as it's not enabled in your eslint config?
Thanks for using oxlint!
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.
Thank you for following up on this issue!
no-children-propis not a big deal because just few errors here. Once the issue withexhaustive-depsis resolved, we can replace the eslint react plugin with the oxlint React plugin.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.
awesome, going to try and do a release today 🤞