-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(eslint): Convert all packages to use central eslint config (#4111)
Convert nextjs, react, node, and serverless to using the central eslint config. This should make sure all packages use a consistent eslint config. In our central eslint config, I've disabled our no-async-await rule in tests and made jsdoc required for only exported methods/classes. For browser we've kept ignorePatterns: ['test/integration/**', 'src/loader.js'],. I think it's fine to not lint the loader, and the integration tests are going to be refactored with the release stability work, so we can keep this for now. Note: Ember is not converted as it's special cased (part of the build) - so I kept it separate. We can have a discussion about what we wanna do with ember, but my opinion is that it's fine to keep it a special case.
- Loading branch information
1 parent
ac20799
commit dcd549b
Showing
22 changed files
with
48 additions
and
153 deletions.
There are no files selected for viewing
This file contains 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 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,51 +1,7 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
es6: true, | ||
browser: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
extends: ['@sentry-internal/sdk'], | ||
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'coverage/**', 'src/loader.js'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx', '*.d.ts'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'jsdoc/require-jsdoc': 'off', | ||
'no-console': 'off', | ||
'max-lines': 'off', | ||
'prefer-template': 'off', | ||
'no-unused-expressions': 'off', | ||
'guard-for-in': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/integration/**'], | ||
env: { | ||
mocha: true, | ||
}, | ||
rules: { | ||
'no-undef': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/integration/common/**', 'test/integration/suites/**'], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'no-prototype-builtins': 'off', | ||
}, | ||
ignorePatterns: ['test/integration/**', 'src/loader.js'], | ||
extends: ['../../.eslintrc.js'], | ||
}; |
This file contains 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 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 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 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 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 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,33 +1,14 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
jsx: true, | ||
}, | ||
extends: ['@sentry-internal/sdk'], | ||
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/integration/**'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx', '*.d.ts'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
], | ||
ignorePatterns: ['test/integration/**'], | ||
extends: ['../../.eslintrc.js'], | ||
rules: { | ||
'max-lines': 'off', | ||
'@sentry-internal/sdk/no-async-await': 'off', | ||
'jsdoc/require-jsdoc': 0, | ||
}, | ||
} | ||
}; |
This file contains 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 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,3 +1,4 @@ | ||
/* eslint-disable max-lines */ | ||
import { | ||
captureException, | ||
configureScope, | ||
|
This file contains 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 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,37 +1,9 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
extends: ['@sentry-internal/sdk'], | ||
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/manual/**'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx', '*.d.ts'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.js'], | ||
rules: { | ||
'import/order': 'off', | ||
}, | ||
}, | ||
], | ||
extends: ['../../.eslintrc.js'], | ||
rules: { | ||
'prefer-rest-params': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@sentry-internal/sdk/no-async-await': 'off', | ||
}, | ||
} | ||
}; |
This file contains 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 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 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,37 +1,18 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
es6: true, | ||
browser: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
jsx: true, | ||
}, | ||
extends: ['@sentry-internal/sdk', 'plugin:react/recommended', 'plugin:react-hooks/recommended'], | ||
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**'], | ||
extends: ['../../.eslintrc.js', 'plugin:react/recommended', 'plugin:react-hooks/recommended'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx', '*.d.ts'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
}, | ||
{ | ||
files: ['*.tsx'], | ||
rules: { | ||
'jsdoc/require-jsdoc': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
// Prop types validation is not useful in test environments | ||
'react/prop-types': 'off', | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'react/prop-types': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
}, | ||
}; |
This file contains 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 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 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 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,33 +1,9 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
extends: ['@sentry-internal/sdk'], | ||
ignorePatterns: ['dist/**', 'esm/**'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.d.ts'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'no-empty': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
], | ||
extends: ['../../.eslintrc.js'], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@sentry-internal/sdk/no-async-await': 'off', | ||
}, | ||
} | ||
}; |
This file contains 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.