-
-
Notifications
You must be signed in to change notification settings - Fork 93
Replace eslint and prettier with oxlint and oxfmt #3250
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
+1,003
−1,960
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6e7e99c
Started replacing eslint with oxlint and prettier with oxfmt.
AndreasArvidsson aa95fb9
Update config
AndreasArvidsson f415c0a
formatter ignore files
AndreasArvidsson b81440a
Update linter
AndreasArvidsson f34917f
Remove nested configs
AndreasArvidsson f99c1fc
Restore sidebar
AndreasArvidsson 53047f5
format
AndreasArvidsson 7291c99
Update eslint disable comments to use oxlint-disable
AndreasArvidsson d3a3b66
Required new error
AndreasArvidsson b9a02b3
Run meta
AndreasArvidsson 9746a3f
Restore type check on lint
AndreasArvidsson 3e225ed
Update pre commit config
AndreasArvidsson 2732029
Added docusaurus type
AndreasArvidsson 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // eslint-disable-next-line import/no-relative-packages | ||
| import { updater } from "../packages/tool-meta-updater/src/index.ts"; | ||
|
|
||
| export default updater; |
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,10 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "sortPackageJson": false, | ||
| "ignorePatterns": [ | ||
| "/packages/app-vscode/src/keyboard/grammar/generated/", | ||
| "/packages/lib-engine/src/customCommandGrammar/generated/", | ||
| "/packages/lib-engine/src/snippets/vendor/", | ||
| "/resources/fixtures/recorded/**/*.yml" | ||
| ] | ||
| } |
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,142 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": ["eslint", "typescript", "unicorn", "oxc", "import"], | ||
| "jsPlugins": [ | ||
| { | ||
| "name": "mocha", | ||
| "specifier": "eslint-plugin-mocha" | ||
| } | ||
| ], | ||
|
|
||
| "ignorePatterns": [ | ||
| "resources/playground/**", | ||
| "packages/app-neovim/cursorless.nvim/**", | ||
| "packages/app-vscode/src/keyboard/grammar/generated/**", | ||
| "packages/lib-engine/src/customCommandGrammar/generated/**", | ||
| "packages/lib-engine/src/snippets/vendor/**" | ||
| ], | ||
|
|
||
| "options": { | ||
| "typeAware": true, | ||
| "typeCheck": false | ||
| }, | ||
|
|
||
| "rules": { | ||
| "curly": "warn", | ||
| "eqeqeq": [ | ||
| "warn", | ||
| "always", | ||
| { | ||
| "null": "never" | ||
| } | ||
| ], | ||
| "eslint/no-constant-condition": [ | ||
| "warn", | ||
| { | ||
| "checkLoops": false | ||
| } | ||
| ], | ||
| "eslint/no-restricted-imports": [ | ||
| "warn", | ||
| { | ||
| "patterns": [ | ||
| { | ||
| "group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"], | ||
| "message": "Relative package imports are not allowed" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "eslint/no-throw-literal": "warn", | ||
| "eslint/no-unused-vars": [ | ||
| "warn", | ||
| { | ||
| "argsIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_", | ||
| "caughtErrorsIgnorePattern": "^_", | ||
| "ignoreRestSiblings": true | ||
| } | ||
| ], | ||
| "import/no-duplicates": "warn", | ||
| "mocha/no-exclusive-tests": "warn", | ||
| "mocha/no-pending-tests": "warn", | ||
| "no-warning-comments": [ | ||
| "warn", | ||
| { | ||
| "terms": ["todo"] | ||
| } | ||
| ], | ||
| "typescript/consistent-type-assertions": [ | ||
| "warn", | ||
| { | ||
| "assertionStyle": "as" | ||
| } | ||
| ], | ||
| "typescript/consistent-type-imports": "warn", | ||
| "typescript/no-base-to-string": "off", | ||
| "typescript/restrict-template-expressions": "off", | ||
| "typescript/unbound-method": "off", | ||
| "unicorn/prefer-module": "warn", | ||
| "unicorn/throw-new-error": "warn" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["packages/app-vscode/src/scripts/**/*.ts"], | ||
| "rules": { | ||
| "no-restricted-imports": [ | ||
| "warn", | ||
| { | ||
| "paths": [ | ||
| { | ||
| "name": "vscode", | ||
| "message": "Scripts shouldn't depend on vscode" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| { | ||
| "files": ["packages/lib-common/**/*.ts", "packages/lib-engine/**/*.ts"], | ||
| "rules": { | ||
| "import/no-nodejs-modules": "warn" | ||
| } | ||
| }, | ||
|
|
||
| { | ||
| "files": [ | ||
| "packages/lib-common/**/*.test.ts", | ||
| "packages/lib-engine/**/*.test.ts", | ||
| "packages/lib-engine/src/scripts/**/*.ts", | ||
| "packages/lib-engine/src/testUtil/**/*.ts" | ||
| ], | ||
| "rules": { | ||
| "import/no-nodejs-modules": "off" | ||
| } | ||
| }, | ||
|
|
||
| { | ||
| "files": ["packages/lib-common/src/types/command/**/*.ts"], | ||
| "rules": { | ||
| "eslint/no-restricted-imports": [ | ||
| "warn", | ||
| { | ||
| "patterns": [ | ||
| { | ||
| "group": ["@cursorless/*", "../*"], | ||
| "message": "API types shouldn't have any dependencies" | ||
| } | ||
| ], | ||
| "paths": [ | ||
| { | ||
| "name": "@*", | ||
| "message": "API types shouldn't have any dependencies" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } |
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.
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 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.
The new hook runs
oxlintwith only--fix, but the repository rule set is configured almost entirely at warning level ("warn"in.oxlintrc.json). Per Oxlint CLI docs, warnings only trigger a non-zero exit with--deny-warnings, so this hook will pass with unresolved lint violations that then fail later in CI (lint:tsusesoxlint --deny-warnings .). This regresses local guardrails by allowing commits that pre-commit should have blocked.Useful? React with 👍 / 👎.