-
Notifications
You must be signed in to change notification settings - Fork 84
build: introduce oxlint #586
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
Open
Mister-Hope
wants to merge
2
commits into
main
Choose a base branch
from
oxlint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "ignorePatterns": ["packages/*/lib/**"], | ||
| "categories": { | ||
| "correctness": "error", | ||
| "suspicious": "warn", | ||
| "pedantic": "warn", | ||
| "perf": "warn", | ||
| "style": "warn", | ||
| "restriction": "off", | ||
| }, | ||
| "plugins": ["import", "unicorn", "oxc", "promise", "jsdoc"], | ||
| "rules": { | ||
| "catch-error-name": ["warn", { "name": "err" }], | ||
| "curly": ["off", "multi-line"], | ||
| "group-exports": "off", | ||
| "id-length": [ | ||
| "warn", | ||
| { "exceptions": ["_", "a", "b", "d", "h", "i", "x", "y", "z"] }, | ||
| ], | ||
| "init-declarations": "off", | ||
| "max-dependencies": "off", | ||
| "max-lines": "off", | ||
| "max-lines-per-function": "off", | ||
| "max-params": ["warn", 4], | ||
| "no-continue": "off", | ||
| "no-console": "warn", | ||
| "no-duplicate-imports": "off", | ||
| "no-magic-numbers": "off", | ||
| // "no-magic-numbers": ["warn", { "ignore": [-1, 0, 1, 2] }], | ||
| "no-nested-ternary": "off", | ||
| "no-null": "off", | ||
| "no-ternary": "off", | ||
| "no-warning-comments": "off", | ||
| "no-unused-vars": ["warn", { "ignoreRestSiblings": true }], | ||
| "sort-imports": "off", | ||
| "sort-keys": "off", | ||
|
|
||
| "import/exports-last": "off", | ||
| // usually we just export vue components as default export without naming it | ||
| "import/no-anonymous-default-export": "off", | ||
| // a rule that shall not be enabled anyway | ||
| "import/no-named-export": "off", | ||
| "import/no-unassigned-import": [ | ||
| "error", | ||
| { "allow": ["**/*.css", "**/*.scss"] }, | ||
| ], | ||
| // named export is preferred in our codebase | ||
| "import/prefer-default-export": "off", | ||
| "jsdoc/require-param": "off", | ||
| "jsdoc/require-param-type": "off", | ||
| "jsdoc/require-returns": "off", | ||
| "jsdoc/require-returns-type": "off", | ||
| "promise/always-return": "off", | ||
| "promise/avoid-new": "off", | ||
| "promise/prefer-await-to-then": "off", | ||
| "unicorn/filename-case": "off", | ||
| // toReversed can introduce memory overhead | ||
| "unicorn/no-array-reverse": "off", | ||
| // toSorted can introduce memory overhead | ||
| "unicorn/no-array-sort": "off", | ||
| "unicorn/no-nested-ternary": "off", | ||
| // at is not supported by our target environments | ||
| "unicorn/prefer-at": "off", | ||
| "unicorn/prefer-global-this": "off", | ||
|
|
||
| // seems conflicts with prettier | ||
| "number-literal-case": "off", | ||
| "numeric-separators-style": "off", | ||
|
|
||
| // style rules | ||
| "capitalized-comments": "off", | ||
| "max-statements": ["warn", { "max": 30 }], | ||
| "no-inline-comments": "off", | ||
|
|
||
| // the following rules are still not supported by oxlint yet | ||
| // "import-x/no-restricted-paths": [ | ||
| // "error", | ||
| // { | ||
| // "zones": [ | ||
| // { | ||
| // "target": "packages/*/src/client/**", | ||
| // "from": "packages/*/src/node/**", | ||
| // }, | ||
| // { | ||
| // "target": "packages/*/src/node/**", | ||
| // "from": "packages/*/src/client/**", | ||
| // }, | ||
| // ], | ||
| // }, | ||
| // ], | ||
| // "vue/multi-word-component-names": [ | ||
| // "error", | ||
| // { "ignores": ["Blog", "Layout", "Slides"] }, | ||
| // ], | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.ts"], | ||
| "plugins": ["typescript"], | ||
| "rules": { | ||
| "typescript/no-floating-promises": [ | ||
| "error", | ||
| { | ||
| "allowForKnownSafeCalls": [ | ||
| // Avoid explicit marking void for router.push | ||
| { | ||
| "from": "package", | ||
| "name": "push", | ||
| "package": "vue-router", | ||
| }, | ||
| // Avoid explicit marking void for router.replace | ||
| { | ||
| "from": "package", | ||
| "name": "replace", | ||
| "package": "vue-router", | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| // we make type casts only when necessary | ||
| "typescript/no-unsafe-type-assertion": "off", | ||
| // skipping it for now, may enable it later | ||
| "typescript/switch-exhaustiveness-check": "off", | ||
| // a lot of time we are just want to check existence | ||
| "typescript/strict-boolean-expressions": "off", | ||
| }, | ||
| }, | ||
| { | ||
| "files": ["**/node/**/*.ts"], | ||
| "plugins": ["node"], | ||
| "rules": { | ||
| "no-restricted-imports": [ | ||
| "error", | ||
| "@vuepress/helper/client", | ||
| "vuepress/client", | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| "files": ["**/client/**/*.ts"], | ||
| "plugins": ["vue"], | ||
| "rules": { | ||
| "no-restricted-imports": [ | ||
| "error", | ||
| "@vuepress/helper", | ||
| "@vuepress/helper/node", | ||
| "vuepress/core", | ||
| "vuepress/markdown", | ||
| "vuepress/utils", | ||
| ], | ||
| "typescript/prefer-nullish-coalescing": [ | ||
| "warn", | ||
| { "ignoreConditionalTests": true }, | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| "files": ["**/__tests__/**"], | ||
| "plugins": ["vitest"], | ||
| }, | ||
| { | ||
| "files": ["**/create/src/**/*.ts"], | ||
| "rules": { | ||
| "no-console": "off", | ||
| }, | ||
| }, | ||
| ], | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export {} |
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
voidoperator has been removed fromrouter.push()calls in some files but remains in other similar locations. For consistency and to fully comply with the oxlint configuration that allows these calls (lines 105-117 in .oxlintrc.jsonc), consider removingvoidfrom the remaining instances at:plugins/features/plugin-notice/src/client/components/Notice.ts:61plugins/search/plugin-docsearch/src/client/composables/useDocSearchSlim.ts:32themes/theme-default/src/client/composables/useNavigate.ts:12,18