-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: migrate to oxlint #19134
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
chore: migrate to oxlint #19134
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
993d98e
chore: initial config and rule setup
logaretm e9ede8d
chore: oxlint config files and scripts
logaretm a3de38d
chore: tidy up oxlint for pr
logaretm d9de095
chore: cleanup eslint
logaretm 6334fdc
chore: include per-package results
logaretm 97ecb4f
chore: adjust complexity rule to match current codebase
logaretm 30d6528
chore: remove eslint ignores
logaretm 114d766
chore: merge test overrides
logaretm 4301e72
chore: cover dev-packages files
logaretm 917292f
chore: re-enable no unused vars
logaretm 4d07ab7
chore: migrate hono to oxlint
logaretm f2fed69
chore: migrate our custom rules to JS plugins
logaretm 071c91b
chore: re-enable customr rules
logaretm f36d05a
fix: use overrides to properly turn off custom rule
logaretm 90a43be
chore: turn off typeaware rules for js vendored files
logaretm 24e76d1
fix: exlucde some rules from tests
logaretm 2aa34c2
fix: turn off some problematic rules
logaretm 8e6f979
chore: switch ci to use oxlint
logaretm 0f17c2b
chore: upgrade oxlint and fmt
logaretm e3e878f
chore: upgrade tsgolint
logaretm 7d073f5
chore: remove gaps since all were addressed
logaretm 83599a7
chore: use the new env flag to disable ts diag
logaretm 75fa821
fix: revert nx json change
logaretm 76bcc1a
fix: lint cmd
logaretm a7e82c9
fix: lint fix scope
logaretm 7bc168c
chore: update agents.md with eslint mentions
logaretm 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": ["typescript", "import", "jsdoc", "jest", "vitest"], | ||
| "jsPlugins": [ | ||
| { | ||
| "name": "sdk", | ||
| "specifier": "@sentry-internal/eslint-plugin-sdk" | ||
| } | ||
| ], | ||
| "categories": {}, | ||
| "rules": { | ||
| // === Base rules from eslint-config-sdk/base.js === | ||
| "no-console": "error", | ||
| "no-alert": "error", | ||
| "no-param-reassign": "error", | ||
| "prefer-template": "error", | ||
| "no-bitwise": "error", | ||
| "complexity": ["error", { "max": 33 }], | ||
| "no-unused-expressions": ["error", { "allowShortCircuit": true }], | ||
| "guard-for-in": "error", | ||
| "array-callback-return": ["error", { "allowImplicit": true }], | ||
| "quotes": ["error", "single", { "avoidEscape": true }], | ||
| "no-return-await": "error", | ||
| "max-lines": ["error", { "max": 300, "skipComments": true, "skipBlankLines": true }], | ||
|
|
||
| // === Import rules === | ||
| "import/namespace": "off", | ||
| "import/no-unresolved": "off", | ||
|
|
||
| // === Jest/Vitest rules === | ||
| "jest/no-focused-tests": "error", | ||
| "jest/no-disabled-tests": "error", | ||
|
|
||
| // === Rules turned off (not enforced in ESLint or causing false positives) === | ||
| "no-control-regex": "off", | ||
| "jsdoc/check-tag-names": "off", | ||
| "jsdoc/require-yields": "off", | ||
| "no-useless-rename": "off", | ||
| "no-constant-binary-expression": "off", | ||
| "jest/no-conditional-expect": "off", | ||
| "jest/expect-expect": "off", | ||
| "jest/no-standalone-expect": "off", | ||
| "jest/require-to-throw-message": "off", | ||
| "jest/valid-title": "off", | ||
| "jest/no-export": "off", | ||
| "jest/valid-describe-callback": "off", | ||
| "vitest/hoisted-apis-on-top": "off", | ||
| "vitest/no-conditional-tests": "off", | ||
| "no-unsafe-optional-chaining": "off", | ||
| "no-eval": "off", | ||
| "no-import-assign": "off", | ||
|
|
||
| // === Custom SDK rules (via JS plugin) === | ||
| "sdk/no-eq-empty": "error" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.ts", "**/*.tsx", "**/*.d.ts"], | ||
| "rules": { | ||
| "typescript/ban-ts-comment": "error", | ||
| "typescript/consistent-type-imports": "error", | ||
| "typescript/no-unnecessary-type-assertion": "error", | ||
| "typescript/prefer-for-of": "error", | ||
| // "typescript/no-floating-promises": ["error", { "ignoreVoid": false }], | ||
| "typescript/no-dynamic-delete": "error", | ||
| // "typescript/no-unsafe-member-access": "error", | ||
| "typescript/unbound-method": "error", | ||
| "typescript/no-explicit-any": "error", | ||
| "typescript/no-empty-function": "off", | ||
|
|
||
| // === FIXME: Rules to turn back as error === | ||
| "typescript/prefer-optional-chain": "warn", | ||
| "typescript/no-floating-promises": "warn", | ||
| "typescript/no-unsafe-member-access": "warn" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/*.js", "**/*.mjs", "**/*.cjs"], | ||
| "rules": { | ||
| "typescript/ban-ts-comment": "off", | ||
| "typescript/consistent-type-imports": "off", | ||
| "typescript/prefer-optional-chain": "off", | ||
| "typescript/no-unnecessary-type-assertion": "off", | ||
| "typescript/prefer-for-of": "off", | ||
| "typescript/no-floating-promises": "off", | ||
| "typescript/no-dynamic-delete": "off", | ||
| "typescript/no-unsafe-member-access": "off", | ||
| "typescript/unbound-method": "off", | ||
| "typescript/no-explicit-any": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/*.test.ts", | ||
| "**/*.test.tsx", | ||
| "**/*.test.js", | ||
| "**/*.test.jsx", | ||
| "**/test/**", | ||
| "**/tests/**", | ||
| "**/suites/**", | ||
| "**/loader-suites/**" | ||
| ], | ||
| "rules": { | ||
| "typescript/explicit-function-return-type": "off", | ||
| "no-unused-expressions": "off", | ||
| "typescript/no-unused-expressions": "off", | ||
| "typescript/no-unnecessary-type-assertion": "off", | ||
| "typescript/no-unsafe-member-access": "off", | ||
| "typescript/no-explicit-any": "off", | ||
| "typescript/no-non-null-assertion": "off", | ||
| "typescript/no-floating-promises": "off", | ||
| "typescript/unbound-method": "off", | ||
| "max-lines": "off", | ||
| "complexity": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["*.tsx"], | ||
| "rules": { | ||
| "jsdoc/require-jsdoc": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["*.config.js", "*.config.mjs", "*.config.ts", "vite.config.ts", ".size-limit.js"], | ||
| "rules": { | ||
| "no-console": "off", | ||
| "max-lines": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/scenarios/**", | ||
| "**/rollup-utils/**", | ||
| "**/bundle-analyzer-scenarios/**", | ||
| "**/bundle-analyzer-scenarios/*.cjs", | ||
| "**/bundle-analyzer-scenarios/*.js" | ||
| ], | ||
| "rules": { | ||
| "no-console": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/src/**"], | ||
| "rules": { | ||
| "no-restricted-globals": ["error", "window", "document", "location", "navigator"], | ||
| "sdk/no-class-field-initializers": "error", | ||
| "sdk/no-regexp-constructor": "error" | ||
| } | ||
| } | ||
| ], | ||
| "env": { | ||
| "es2017": true, | ||
| "node": true | ||
| }, | ||
| "globals": {}, | ||
| "ignorePatterns": [ | ||
| "coverage/**", | ||
| "build/**", | ||
| "dist/**", | ||
| "cjs/**", | ||
| "esm/**", | ||
| "examples/**", | ||
| "test/manual/**", | ||
| "types/**", | ||
| "scripts/*.js", | ||
| "node_modules/**" | ||
| ] | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "$schema": "../node_modules/oxlint/configuration_schema.json", | ||
| "extends": ["../.oxlintrc.json"], | ||
| "rules": { | ||
| "typescript/no-explicit-any": "off", | ||
| "max-lines": "off", | ||
| "no-unused-expressions": "off" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "$schema": "../../node_modules/oxlint/configuration_schema.json", | ||
| "extends": ["../.oxlintrc.json"], | ||
| "env": { | ||
| "browser": true, | ||
| "node": true | ||
| }, | ||
| "ignorePatterns": [ | ||
| "suites/**/subject.js", | ||
| "suites/**/dist/*", | ||
| "loader-suites/**/dist/*", | ||
| "loader-suites/**/subject.js", | ||
| "scripts/**", | ||
| "fixtures/**", | ||
| "tmp/**" | ||
| ], | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.ts", "**/*.tsx"], | ||
| "rules": { | ||
| "typescript/no-unsafe-member-access": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["loader-suites/**/{subject,init}.js"], | ||
| "globals": { | ||
| "Sentry": "readonly" | ||
| } | ||
| } | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "../../node_modules/oxlint/configuration_schema.json", | ||
| "extends": ["../.oxlintrc.json"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "../../node_modules/oxlint/configuration_schema.json", | ||
| "extends": ["../.oxlintrc.json"] | ||
| } |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.