This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
124 lines (122 loc) · 3.55 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// TODO: Remove this file after migration!
// TODO: Remove Sentry ESLint config package from package.json
// Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file
// lives
// ESLint config docs: https://eslint.org/docs/user-guide/configuring/
module.exports = {
root: true,
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
},
extends: ['@sentry-internal/sdk'],
ignorePatterns: [
'coverage/**',
'build/**',
'dist/**',
'cjs/**',
'esm/**',
'examples/**',
'test/manual/**',
'types/**',
// TODO: Remove these after migration
'scripts/**',
'config/**',
'config/**',
'__mocks__/**',
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
parserOptions: {
project: ['tsconfig.json'],
},
},
// TODO: Extract this to package-specific config after mgiration
{
files: ['worker/**/*.ts'],
parserOptions: {
project: ['config/tsconfig.worker.json'],
},
},
{
files: ['*.ts', '*.tsx', '*.d.ts'],
rules: {
// TODO (high-prio): Go through console logs and figure out which ones should be replaced with the SDK logger
'no-console': 'off',
// TODO (high-pio): Re-enable this after migration
'no-restricted-globals': 'off',
// TODO (high-prio): Re-enable this after migration
'@typescript-eslint/explicit-member-accessibility': 'off',
// TODO (high-prio): Remove this exception from naming convention after migration
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'memberLike',
modifiers: ['protected'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
],
// TODO (high-prio): Re-enable this after migration
'@sentry-internal/sdk/no-async-await': 'off',
// TODO (high-prio): Re-enable this after migration
'@typescript-eslint/no-floating-promises': 'off',
// TODO (medium-prio): Re-enable this after migration
'jsdoc/require-jsdoc': 'off',
// TODO: Do we even want to turn this on? Why not enable ++?
'no-plusplus': 'off',
},
},
{
files: ['jest.setup.ts'],
rules: {
'no-console': 'off',
},
},
{
files: ['test/**/*.ts'],
rules: {
// TODO: decide if we want to keep our '@test' import paths
'import/no-unresolved': 'off',
// most of these errors come from `new Promise(process.nextTick)`
'@typescript-eslint/unbound-method': 'off',
// TODO: decide if we want to enable this again after the migration
// We can take the freedom to be a bit more lenient with tests
'@typescript-eslint/no-floating-promises': 'off',
},
},
{
files: ['src/worker/**/*.js'],
parserOptions: {
sourceType: 'module',
},
},
// ----------------
{
files: ['*.tsx'],
rules: {
// Turn off jsdoc on tsx files until jsdoc is fixed for tsx files
// See: https://github.com/getsentry/sentry-javascript/issues/3871
'jsdoc/require-jsdoc': 'off',
},
},
{
files: ['scenarios/**', 'rollup/**'],
parserOptions: {
sourceType: 'module',
},
rules: {
'no-console': 'off',
},
},
],
};