-
-
Notifications
You must be signed in to change notification settings - Fork 360
chore: Migrate from ESLint to oxlint #5867
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
Changes from 21 commits
5e875f4
66bf368
f195136
6974836
1005db9
d9c5dad
965145f
b494dcd
646c619
c39e3e6
79b90c5
cdd3c89
7f45543
6f74c8c
8d1eb87
09f0618
089e0c9
ee86488
48885d2
57c0565
93a3e5e
7043c1d
4cab60e
c154b11
094bfde
d133ef2
1a51e28
b3fe91a
1eda38c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| // See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
| // for the documentation about the extensions.json format | ||
| "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] | ||
| "recommendations": ["esbenp.prettier-vscode", "nickelpack.oxlint"] | ||
| } |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": ["typescript", "react", "import", "jsdoc"], | ||
| "jsPlugins": [ | ||
| { | ||
| "name": "sdk", | ||
| "specifier": "@sentry-internal/eslint-plugin-sdk" | ||
| } | ||
| ], | ||
| "categories": {}, | ||
| "rules": { | ||
| "no-unused-vars": [ | ||
| "warn", | ||
| { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" } | ||
| ], | ||
|
|
||
| // === Base rules (ported from @sentry-internal/eslint-config-sdk) === | ||
| "no-console": "error", | ||
| "no-alert": "error", | ||
| "no-param-reassign": "error", | ||
| "prefer-template": "error", | ||
| "no-bitwise": "error", | ||
| "complexity": "error", | ||
| "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", | ||
|
|
||
| // === Rules turned off (not needed or causing false positives) === | ||
| "no-control-regex": "off", | ||
| "jsdoc/check-tag-names": "off", | ||
| "jsdoc/require-yields": "off", | ||
| "no-shadow": "off", | ||
| "no-unsafe-optional-chaining": "off", | ||
| // Not in original ESLint config โ auto-enabled by --type-aware, produces false positives on mocked functions | ||
| "typescript/await-thenable": "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/explicit-function-return-type": ["error", { "allowExpressions": true }], | ||
| "typescript/no-floating-promises": ["error", { "ignoreVoid": false }], | ||
| "typescript/no-dynamic-delete": "error", | ||
| "typescript/unified-signatures": "error", | ||
| "typescript/no-unsafe-member-access": "error", | ||
| "typescript/unbound-method": "error", | ||
| "typescript/no-explicit-any": "warn", | ||
| "typescript/no-empty-function": "off", | ||
| "typescript/no-empty-object-type": "off", | ||
| "typescript/no-require-imports": "off", | ||
| "typescript/prefer-optional-chain": "error", | ||
| "typescript/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "caughtErrors": "none" }], | ||
| "typescript/no-redundant-type-constituents": "off", | ||
| "typescript/restrict-template-expressions": "off", | ||
| "typescript/no-base-to-string": "off" | ||
| } | ||
| }, | ||
| { | ||
| "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", | ||
| "typescript/explicit-function-return-type": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/*.test.ts", | ||
| "**/*.test.tsx", | ||
| "**/*.test.js", | ||
| "**/*.test.jsx", | ||
| "test/**/*.ts", | ||
| "test/**/*.js" | ||
| ], | ||
| "rules": { | ||
| "typescript/explicit-function-return-type": "off", | ||
| "typescript/no-empty-function": "off", | ||
| "typescript/no-explicit-any": "off", | ||
| "typescript/no-unsafe-member-access": "off", | ||
| "typescript/no-floating-promises": "off", | ||
| "typescript/no-non-null-assertion": "off", | ||
| "typescript/unbound-method": "off", | ||
| "no-unused-expressions": "off", | ||
| "typescript/no-unused-expressions": "off", | ||
| "max-lines": "off", | ||
| "complexity": "off", | ||
| "import/first": "off", | ||
| "typescript/prefer-optional-chain": "off", | ||
| "typescript/no-misused-spread": "off", | ||
| "sdk/no-focused-tests": "error", | ||
| "sdk/no-skipped-tests": "error" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["*.tsx"], | ||
| "rules": { | ||
| "jsdoc/require-jsdoc": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["scripts/*"], | ||
| "rules": { | ||
| "no-console": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/src/**"], | ||
| "rules": { | ||
| "no-restricted-globals": ["error", "window", "document", "location", "navigator"], | ||
| // Bundle size isn't a concern for React Native | ||
| "sdk/no-class-field-initializers": "off", | ||
| // TODO: Re-enable once oxlint supports inline disable for jsPlugin rules | ||
| // Only 2 intentional uses exist (debugsymbolicator.ts, sentryMetroSerializer.ts) | ||
| "sdk/no-regexp-constructor": "off" | ||
| } | ||
| } | ||
| ], | ||
| "ignorePatterns": [ | ||
| "dist/**", | ||
| "dangerfile.js", | ||
| "RNSentryAndroidTester/**", | ||
| "test/react-native/versions/**", | ||
| "coverage/**", | ||
| "test/typescript/**", | ||
| "metro.d.ts", | ||
| "plugin/build/**", | ||
| "expo.d.ts", | ||
| "playground.js", | ||
| "playground.d.ts", | ||
| "node_modules/**" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| /* oxlint-disable typescript-eslint(no-unsafe-member-access) */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we disable it here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Removed with 4cab60e |
||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import { warnOnce } from './logger'; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.