eslint-config-adslot 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +318 -307
  2. package/package.json +11 -11
package/index.js CHANGED
@@ -4,332 +4,343 @@
4
4
  // We blacklist the globals that we deem potentially confusing.
5
5
  // To use them, explicitly reference them, e.g. `window.name` or `window.status`.
6
6
  const restrictedGlobals = require('confusing-browser-globals');
7
+ const eslintConfigPrettier = require('eslint-config-prettier');
8
+ const eslintPluginImport = require('eslint-plugin-import');
9
+ const eslintPluginJsxA11y = require('eslint-plugin-jsx-a11y');
10
+ const eslintPluginReact = require('eslint-plugin-react');
11
+ const eslintPluginReactHooks = require('eslint-plugin-react-hooks');
12
+ const eslintPluginLodash = require('eslint-plugin-lodash');
13
+ const eslintPluginChaiFriendly = require('eslint-plugin-chai-friendly');
14
+ const eslintPluginJest = require('eslint-plugin-jest');
15
+ const eslintPluginNoSnapshotTesting = require('eslint-plugin-no-snapshot-testing');
16
+ const eslintPluginTypescript = require('@typescript-eslint/eslint-plugin');
17
+ const globals = require('globals');
7
18
 
8
- module.exports = {
9
- env: {
10
- browser: true,
11
- commonjs: true,
12
- es2021: true,
13
- jest: true,
14
- node: true,
15
- mocha: true,
16
- },
17
-
18
- parserOptions: {
19
- ecmaVersion: 'latest',
20
- sourceType: 'module',
21
- ecmaFeatures: {
22
- jsx: true,
23
- },
24
- },
25
-
26
- settings: {
27
- react: {
28
- version: 'detect',
29
- },
30
- 'import/resolver': {
31
- node: {
32
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
19
+ module.exports = [
20
+ eslintConfigPrettier,
21
+ {
22
+ languageOptions: {
23
+ globals: {
24
+ ...globals.browser,
25
+ ...globals.commonjs,
26
+ ...globals.es2021,
27
+ ...globals.jest,
28
+ ...globals.node,
29
+ ...globals.mocha,
33
30
  },
34
- },
35
- },
36
-
37
- plugins: [
38
- 'import',
39
- 'jsx-a11y',
40
- 'react',
41
- 'react-hooks',
42
- 'lodash',
43
- 'chai-friendly',
44
- 'jest',
45
- 'no-snapshot-testing',
46
- ],
47
-
48
- extends: ['prettier'],
49
-
50
- overrides: [
51
- {
52
- files: ['**/*.ts?(x)'],
53
- parser: '@typescript-eslint/parser',
31
+ ecmaVersion: 'latest',
32
+ sourceType: 'module',
54
33
  parserOptions: {
55
- ecmaVersion: 2018,
56
- sourceType: 'module',
57
34
  ecmaFeatures: {
58
35
  jsx: true,
36
+ modules: true,
59
37
  },
60
-
61
- // typescript-eslint specific options
62
- warnOnUnsupportedTypeScriptVersion: true,
63
38
  },
64
- plugins: ['@typescript-eslint'],
65
-
66
- extends: ['prettier'],
67
-
68
- // If adding a typescript-eslint version of an existing ESLint rule,
69
- // make sure to disable the ESLint rule here.
70
- rules: {
71
- // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
72
- 'default-case': 'off',
73
- // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
74
- 'no-dupe-class-members': 'off',
75
- // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
76
- 'no-undef': 'off',
77
-
78
- // Add TypeScript specific rules (and turn off ESLint equivalents)
79
- '@typescript-eslint/consistent-type-assertions': 'error',
80
- 'no-array-constructor': 'off',
81
- '@typescript-eslint/no-array-constructor': 'error',
82
- '@typescript-eslint/no-namespace': 'error',
83
- 'no-use-before-define': 'off',
84
- '@typescript-eslint/no-use-before-define': [
85
- 'error',
86
- {
87
- functions: false,
88
- classes: false,
89
- variables: false,
90
- typedefs: false,
91
- },
92
- ],
93
- 'no-unused-vars': 'off',
94
- '@typescript-eslint/no-unused-vars': [
95
- 'error',
96
- {
97
- args: 'none',
98
- ignoreRestSiblings: true,
99
- },
100
- ],
101
- 'no-useless-constructor': 'off',
102
- '@typescript-eslint/no-useless-constructor': 'error',
103
- '@typescript-eslint/no-explicit-any': 'error',
39
+ },
40
+ settings: {
41
+ react: {
42
+ version: 'detect',
43
+ },
44
+ 'import/resolver': {
45
+ node: {
46
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
47
+ },
104
48
  },
105
49
  },
106
- ],
50
+ plugins: {
51
+ 'import': eslintPluginImport,
52
+ 'jsx-a11y': eslintPluginJsxA11y,
53
+ 'react': eslintPluginReact,
54
+ 'react-hooks': eslintPluginReactHooks,
55
+ 'lodash': eslintPluginLodash,
56
+ 'chai-friendly': eslintPluginChaiFriendly,
57
+ 'jest': eslintPluginJest,
58
+ 'no-snapshot-testing': eslintPluginNoSnapshotTesting,
59
+ },
60
+ // NOTE: When adding rules here, you need to make sure they are compatible with
61
+ // `typescript-eslint`, as some rules such as `no-array-constructor` aren't compatible.
62
+ rules: {
63
+ // http://eslint.org/docs/rules/
64
+ 'array-callback-return': 'error',
65
+ 'default-case': ['error', { commentPattern: '^no default$' }],
66
+ eqeqeq: ['error', 'smart'],
67
+ 'no-array-constructor': 'error',
68
+ 'no-caller': 'error',
69
+ 'no-cond-assign': ['error', 'except-parens'],
70
+ 'no-const-assign': 'error',
71
+ 'no-control-regex': 'error',
72
+ 'no-delete-var': 'error',
73
+ 'no-dupe-args': 'error',
74
+ 'no-dupe-class-members': 'error',
75
+ 'no-dupe-keys': 'error',
76
+ 'no-duplicate-case': 'error',
77
+ 'no-empty-character-class': 'error',
78
+ 'no-empty-pattern': 'error',
79
+ 'no-eval': 'error',
80
+ 'no-ex-assign': 'error',
81
+ 'no-extend-native': 'error',
82
+ 'no-extra-bind': 'error',
83
+ 'no-extra-label': 'error',
84
+ 'no-fallthrough': 'error',
85
+ 'no-func-assign': 'error',
86
+ 'no-implied-eval': 'error',
87
+ 'no-invalid-regexp': 'error',
88
+ 'no-iterator': 'error',
89
+ 'no-label-var': 'error',
90
+ 'no-labels': ['error', { allowLoop: true, allowSwitch: false }],
91
+ 'no-lone-blocks': 'error',
92
+ 'no-loop-func': 'error',
93
+ 'no-multi-str': 'error',
94
+ 'no-native-reassign': 'error',
95
+ 'no-negated-in-lhs': 'error',
96
+ 'no-new-func': 'error',
97
+ 'no-new-object': 'error',
98
+ 'no-new-symbol': 'error',
99
+ 'no-new-wrappers': 'error',
100
+ 'no-obj-calls': 'error',
101
+ 'no-octal': 'error',
102
+ 'no-octal-escape': 'error',
103
+ 'no-redeclare': ['error', { builtinGlobals: false }],
104
+ 'no-regex-spaces': 'error',
105
+ 'no-restricted-syntax': ['error', 'WithStatement'],
106
+ 'no-script-url': 'error',
107
+ 'no-self-assign': 'error',
108
+ 'no-self-compare': 'error',
109
+ 'no-sequences': 'error',
110
+ 'no-shadow-restricted-names': 'error',
111
+ 'no-sparse-arrays': 'error',
112
+ 'no-template-curly-in-string': 'error',
113
+ 'no-this-before-super': 'error',
114
+ 'no-throw-literal': 'error',
115
+ 'no-undef': 'error',
116
+ 'no-restricted-globals': ['error'].concat(restrictedGlobals),
117
+ 'no-unreachable': 'error',
118
+ 'no-shadow': ['error', { allow: ['cb', 'err', 'done', 'next'] }],
119
+ 'no-console': 'error',
120
+
121
+ 'no-unused-expressions': 'off',
122
+ 'chai-friendly/no-unused-expressions': [
123
+ 'error',
124
+ {
125
+ allowShortCircuit: true,
126
+ allowTernary: true,
127
+ allowTaggedTemplates: true,
128
+ },
129
+ ],
130
+ 'no-unused-labels': 'error',
131
+ 'no-unused-vars': [
132
+ 'error',
133
+ {
134
+ args: 'all',
135
+ ignoreRestSiblings: true,
136
+ argsIgnorePattern: '^_',
137
+ caughtErrors: 'none',
138
+ },
139
+ ],
140
+ 'no-use-before-define': [
141
+ 'error',
142
+ {
143
+ functions: false,
144
+ classes: false,
145
+ variables: false,
146
+ },
147
+ ],
148
+ 'no-useless-computed-key': 'error',
149
+ 'no-useless-concat': 'error',
150
+ 'no-useless-constructor': 'error',
151
+ 'no-useless-escape': 'error',
152
+ 'no-useless-rename': [
153
+ 'error',
154
+ {
155
+ ignoreDestructuring: false,
156
+ ignoreImport: false,
157
+ ignoreExport: false,
158
+ },
159
+ ],
160
+ 'no-with': 'error',
161
+ 'react-hooks/exhaustive-deps': 'error',
162
+ 'require-yield': 'error',
163
+ strict: ['error', 'never'],
164
+ 'use-isnan': 'error',
165
+ 'valid-typeof': 'error',
166
+ 'no-restricted-properties': [
167
+ 'error',
168
+ {
169
+ object: 'require',
170
+ property: 'ensure',
171
+ message:
172
+ 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
173
+ },
174
+ {
175
+ object: 'System',
176
+ property: 'import',
177
+ message:
178
+ 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
179
+ },
180
+ ],
181
+ 'getter-return': 'error',
107
182
 
108
- // NOTE: When adding rules here, you need to make sure they are compatible with
109
- // `typescript-eslint`, as some rules such as `no-array-constructor` aren't compatible.
110
- rules: {
111
- // http://eslint.org/docs/rules/
112
- 'array-callback-return': 'error',
113
- 'default-case': ['error', { commentPattern: '^no default$' }],
114
- eqeqeq: ['error', 'smart'],
115
- 'no-array-constructor': 'error',
116
- 'no-caller': 'error',
117
- 'no-cond-assign': ['error', 'except-parens'],
118
- 'no-const-assign': 'error',
119
- 'no-control-regex': 'error',
120
- 'no-delete-var': 'error',
121
- 'no-dupe-args': 'error',
122
- 'no-dupe-class-members': 'error',
123
- 'no-dupe-keys': 'error',
124
- 'no-duplicate-case': 'error',
125
- 'no-empty-character-class': 'error',
126
- 'no-empty-pattern': 'error',
127
- 'no-eval': 'error',
128
- 'no-ex-assign': 'error',
129
- 'no-extend-native': 'error',
130
- 'no-extra-bind': 'error',
131
- 'no-extra-label': 'error',
132
- 'no-fallthrough': 'error',
133
- 'no-func-assign': 'error',
134
- 'no-implied-eval': 'error',
135
- 'no-invalid-regexp': 'error',
136
- 'no-iterator': 'error',
137
- 'no-label-var': 'error',
138
- 'no-labels': ['error', { allowLoop: true, allowSwitch: false }],
139
- 'no-lone-blocks': 'error',
140
- 'no-loop-func': 'error',
141
- 'no-multi-str': 'error',
142
- 'no-native-reassign': 'error',
143
- 'no-negated-in-lhs': 'error',
144
- 'no-new-func': 'error',
145
- 'no-new-object': 'error',
146
- 'no-new-symbol': 'error',
147
- 'no-new-wrappers': 'error',
148
- 'no-obj-calls': 'error',
149
- 'no-octal': 'error',
150
- 'no-octal-escape': 'error',
151
- 'no-redeclare': ['error', { builtinGlobals: false }],
152
- 'no-regex-spaces': 'error',
153
- 'no-restricted-syntax': ['error', 'WithStatement'],
154
- 'no-script-url': 'error',
155
- 'no-self-assign': 'error',
156
- 'no-self-compare': 'error',
157
- 'no-sequences': 'error',
158
- 'no-shadow-restricted-names': 'error',
159
- 'no-sparse-arrays': 'error',
160
- 'no-template-curly-in-string': 'error',
161
- 'no-this-before-super': 'error',
162
- 'no-throw-literal': 'error',
163
- 'no-undef': 'error',
164
- 'no-restricted-globals': ['error'].concat(restrictedGlobals),
165
- 'no-unreachable': 'error',
166
- 'no-shadow': ['error', { allow: ['cb', 'err', 'done', 'next'] }],
167
- 'no-console': 'error',
183
+ // https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
184
+ 'import/first': 'error',
185
+ 'import/no-amd': 'error',
186
+ 'import/no-webpack-loader-syntax': 'error',
187
+ 'import/order': [
188
+ 'error',
189
+ { groups: [['builtin', 'external', 'internal']] },
190
+ ],
191
+ 'import/no-cycle': 'error',
192
+ 'import/no-unresolved': ['error', { commonjs: true }],
193
+ 'import/no-duplicates': 'error',
168
194
 
169
- 'no-unused-expressions': 'off',
170
- 'chai-friendly/no-unused-expressions': [
171
- 'error',
172
- {
173
- allowShortCircuit: true,
174
- allowTernary: true,
175
- allowTaggedTemplates: true,
176
- },
177
- ],
178
- 'no-unused-labels': 'error',
179
- 'no-unused-vars': [
180
- 'error',
181
- {
182
- args: 'all',
183
- ignoreRestSiblings: true,
184
- argsIgnorePattern: '^_',
185
- },
186
- ],
187
- 'no-use-before-define': [
188
- 'error',
189
- {
190
- functions: false,
191
- classes: false,
192
- variables: false,
193
- },
194
- ],
195
- 'no-useless-computed-key': 'error',
196
- 'no-useless-concat': 'error',
197
- 'no-useless-constructor': 'error',
198
- 'no-useless-escape': 'error',
199
- 'no-useless-rename': [
200
- 'error',
201
- {
202
- ignoreDestructuring: false,
203
- ignoreImport: false,
204
- ignoreExport: false,
205
- },
206
- ],
207
- 'no-with': 'error',
208
- 'react-hooks/exhaustive-deps': 'error',
209
- 'require-yield': 'error',
210
- strict: ['error', 'never'],
211
- 'use-isnan': 'error',
212
- 'valid-typeof': 'error',
213
- 'no-restricted-properties': [
214
- 'error',
215
- {
216
- object: 'require',
217
- property: 'ensure',
218
- message:
219
- 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
220
- },
221
- {
222
- object: 'System',
223
- property: 'import',
224
- message:
225
- 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
226
- },
227
- ],
228
- 'getter-return': 'error',
195
+ // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
196
+ 'react/forbid-foreign-prop-types': ['error', { allowInPropTypes: true }],
197
+ 'react/jsx-no-comment-textnodes': 'error',
198
+ 'react/jsx-no-duplicate-props': 'error',
199
+ 'react/jsx-no-target-blank': 'error',
200
+ 'react/jsx-no-undef': 'error',
201
+ 'react/jsx-pascal-case': [
202
+ 'error',
203
+ {
204
+ allowAllCaps: true,
205
+ ignore: [],
206
+ },
207
+ ],
208
+ 'react/jsx-uses-react': 'error',
209
+ 'react/jsx-uses-vars': 'error',
210
+ 'react/no-danger-with-children': 'error',
211
+ // Disabled because of undesirable warnings
212
+ // See https://github.com/facebook/create-react-app/issues/5204 for
213
+ // blockers until its re-enabled
214
+ // 'react/no-deprecated': 'error',
215
+ 'react/no-direct-mutation-state': 'error',
216
+ 'react/no-is-mounted': 'error',
217
+ 'react/no-typos': 'error',
218
+ 'react/react-in-jsx-scope': 'error',
219
+ 'react/require-render-return': 'error',
220
+ 'react/style-prop-object': 'error',
229
221
 
230
- // https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
231
- 'import/first': 'error',
232
- 'import/no-amd': 'error',
233
- 'import/no-webpack-loader-syntax': 'error',
234
- 'import/order': [
235
- 'error',
236
- { groups: [['builtin', 'external', 'internal']] },
237
- ],
238
- 'import/no-cycle': 'error',
239
- 'import/no-unresolved': ['error', { commonjs: true }],
240
- 'import/no-duplicates': 'error',
222
+ // Prevent missing props validation in a React component definition
223
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
224
+ 'react/prop-types': [
225
+ 'error',
226
+ {
227
+ ignore: [],
228
+ customValidators: [],
229
+ skipUndeclared: true, // only enable the check for components that have .propTypes declared
230
+ },
231
+ ],
241
232
 
242
- // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
243
- 'react/forbid-foreign-prop-types': ['error', { allowInPropTypes: true }],
244
- 'react/jsx-no-comment-textnodes': 'error',
245
- 'react/jsx-no-duplicate-props': 'error',
246
- 'react/jsx-no-target-blank': 'error',
247
- 'react/jsx-no-undef': 'error',
248
- 'react/jsx-pascal-case': [
249
- 'error',
250
- {
251
- allowAllCaps: true,
252
- ignore: [],
253
- },
254
- ],
255
- 'react/jsx-uses-react': 'error',
256
- 'react/jsx-uses-vars': 'error',
257
- 'react/no-danger-with-children': 'error',
258
- // Disabled because of undesirable warnings
259
- // See https://github.com/facebook/create-react-app/issues/5204 for
260
- // blockers until its re-enabled
261
- // 'react/no-deprecated': 'error',
262
- 'react/no-direct-mutation-state': 'error',
263
- 'react/no-is-mounted': 'error',
264
- 'react/no-typos': 'error',
265
- 'react/react-in-jsx-scope': 'error',
266
- 'react/require-render-return': 'error',
267
- 'react/style-prop-object': 'error',
233
+ // Prevent invalid characters from appearing in markup
234
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
235
+ 'react/no-unescaped-entities': 'error',
268
236
 
269
- // Prevent missing props validation in a React component definition
270
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
271
- 'react/prop-types': [
272
- 'error',
273
- {
274
- ignore: [],
275
- customValidators: [],
276
- skipUndeclared: true, // only enable the check for components that have .propTypes declared
277
- },
278
- ],
237
+ // Prevent using this.state within a this.setState
238
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
239
+ 'react/no-access-state-in-setstate': 'error',
279
240
 
280
- // Prevent invalid characters from appearing in markup
281
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
282
- 'react/no-unescaped-entities': 'error',
241
+ // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
242
+ 'jsx-a11y/accessible-emoji': 'error',
243
+ 'jsx-a11y/alt-text': 'error',
244
+ 'jsx-a11y/anchor-has-content': 'error',
245
+ 'jsx-a11y/anchor-is-valid': [
246
+ 'error',
247
+ {
248
+ aspects: ['noHref', 'invalidHref'],
249
+ },
250
+ ],
251
+ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
252
+ 'jsx-a11y/aria-props': 'error',
253
+ 'jsx-a11y/aria-proptypes': 'error',
254
+ 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: true }],
255
+ 'jsx-a11y/aria-unsupported-elements': 'error',
256
+ 'jsx-a11y/heading-has-content': 'error',
257
+ 'jsx-a11y/iframe-has-title': 'error',
258
+ 'jsx-a11y/img-redundant-alt': 'error',
259
+ 'jsx-a11y/no-access-key': 'error',
260
+ 'jsx-a11y/no-distracting-elements': 'error',
261
+ 'jsx-a11y/no-redundant-roles': 'error',
262
+ 'jsx-a11y/role-has-required-aria-props': 'error',
263
+ 'jsx-a11y/role-supports-aria-props': 'error',
264
+ 'jsx-a11y/scope': 'error',
283
265
 
284
- // Prevent using this.state within a this.setState
285
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
286
- 'react/no-access-state-in-setstate': 'error',
266
+ // https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
267
+ 'react-hooks/rules-of-hooks': 'error',
287
268
 
288
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
289
- 'jsx-a11y/accessible-emoji': 'error',
290
- 'jsx-a11y/alt-text': 'error',
291
- 'jsx-a11y/anchor-has-content': 'error',
292
- 'jsx-a11y/anchor-is-valid': [
293
- 'error',
294
- {
295
- aspects: ['noHref', 'invalidHref'],
296
- },
297
- ],
298
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
299
- 'jsx-a11y/aria-props': 'error',
300
- 'jsx-a11y/aria-proptypes': 'error',
301
- 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: true }],
302
- 'jsx-a11y/aria-unsupported-elements': 'error',
303
- 'jsx-a11y/heading-has-content': 'error',
304
- 'jsx-a11y/iframe-has-title': 'error',
305
- 'jsx-a11y/img-redundant-alt': 'error',
306
- 'jsx-a11y/no-access-key': 'error',
307
- 'jsx-a11y/no-distracting-elements': 'error',
308
- 'jsx-a11y/no-redundant-roles': 'error',
309
- 'jsx-a11y/role-has-required-aria-props': 'error',
310
- 'jsx-a11y/role-supports-aria-props': 'error',
311
- 'jsx-a11y/scope': 'error',
269
+ // https://github.com/wix/eslint-plugin-lodash
270
+ 'lodash/callback-binding': 'error',
271
+ 'lodash/collection-method-value': 'error',
272
+ 'lodash/collection-return': 'error',
273
+ 'lodash/no-double-unwrap': 'error',
274
+ 'lodash/no-extra-args': 'error',
275
+ 'lodash/no-unbound-this': 'error',
276
+ 'lodash/unwrap': 'error',
277
+ 'lodash/chain-style': ['error', 'as-needed'],
278
+ 'lodash/chaining': ['error', 'always'],
279
+ 'lodash/path-style': ['error', 'string'],
312
280
 
313
- // https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
314
- 'react-hooks/rules-of-hooks': 'error',
281
+ // https://github.com/jest-community/eslint-plugin-jest
282
+ // could also be used in non-jest tests
283
+ 'jest/no-disabled-tests': 'error',
284
+ 'jest/no-focused-tests': 'error',
315
285
 
316
- // https://github.com/wix/eslint-plugin-lodash
317
- 'lodash/callback-binding': 'error',
318
- 'lodash/collection-method-value': 'error',
319
- 'lodash/collection-return': 'error',
320
- 'lodash/no-double-unwrap': 'error',
321
- 'lodash/no-extra-args': 'error',
322
- 'lodash/no-unbound-this': 'error',
323
- 'lodash/unwrap': 'error',
324
- 'lodash/chain-style': ['error', 'as-needed'],
325
- 'lodash/chaining': ['error', 'always'],
326
- 'lodash/path-style': ['error', 'string'],
286
+ 'no-snapshot-testing/no-snapshot-testing': 'error',
287
+ },
288
+ },
289
+ {
290
+ files: ['**/*.ts?(x)'],
291
+ languageOptions: {
292
+ ecmaVersion: 2018,
293
+ sourceType: 'module',
294
+ parser: '@typescript-eslint/parser',
295
+ parserOptions: {
296
+ ecmaFeatures: {
297
+ jsx: true,
298
+ },
299
+ // typescript-eslint specific options
300
+ warnOnUnsupportedTypeScriptVersion: true,
301
+ },
302
+ },
303
+ plugins: {
304
+ '@typescript-eslint': eslintPluginTypescript,
305
+ },
327
306
 
328
- // https://github.com/jest-community/eslint-plugin-jest
329
- // could also be used in non-jest tests
330
- 'jest/no-disabled-tests': 'error',
331
- 'jest/no-focused-tests': 'error',
307
+ // If adding a typescript-eslint version of an existing ESLint rule,
308
+ // make sure to disable the ESLint rule here.
309
+ rules: {
310
+ // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
311
+ 'default-case': 'off',
312
+ // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
313
+ 'no-dupe-class-members': 'off',
314
+ // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
315
+ 'no-undef': 'off',
332
316
 
333
- "no-snapshot-testing/no-snapshot-testing": "error",
317
+ // Add TypeScript specific rules (and turn off ESLint equivalents)
318
+ '@typescript-eslint/consistent-type-assertions': 'error',
319
+ 'no-array-constructor': 'off',
320
+ '@typescript-eslint/no-array-constructor': 'error',
321
+ '@typescript-eslint/no-namespace': 'error',
322
+ 'no-use-before-define': 'off',
323
+ '@typescript-eslint/no-use-before-define': [
324
+ 'error',
325
+ {
326
+ functions: false,
327
+ classes: false,
328
+ variables: false,
329
+ typedefs: false,
330
+ },
331
+ ],
332
+ 'no-unused-vars': 'off',
333
+ '@typescript-eslint/no-unused-vars': [
334
+ 'error',
335
+ {
336
+ args: 'none',
337
+ ignoreRestSiblings: true,
338
+ caughtErrors: 'none',
339
+ },
340
+ ],
341
+ 'no-useless-constructor': 'off',
342
+ '@typescript-eslint/no-useless-constructor': 'error',
343
+ '@typescript-eslint/no-explicit-any': 'error',
344
+ },
334
345
  },
335
- };
346
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-adslot",
3
- "version": "1.9.0",
3
+ "version": "2.0.0",
4
4
  "description": "ESLint configuration for Adslot",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -31,20 +31,20 @@
31
31
  "release:patch": "npm version patch -m 'build: release patch version %s'"
32
32
  },
33
33
  "dependencies": {
34
- "@typescript-eslint/eslint-plugin": "^7.18.0",
35
- "@typescript-eslint/parser": "^7.18.0",
34
+ "@typescript-eslint/eslint-plugin": "^8.21.0",
35
+ "@typescript-eslint/parser": "^8.21.0",
36
36
  "confusing-browser-globals": "^1.0.11",
37
- "eslint-config-prettier": "^9.1.0",
38
- "eslint-plugin-chai-friendly": "^0.7.4",
37
+ "eslint-config-prettier": "^10.0.1",
38
+ "eslint-plugin-chai-friendly": "^1.0.1",
39
39
  "eslint-plugin-import": "^2.31.0",
40
- "eslint-plugin-jest": "^28.8.3",
41
- "eslint-plugin-jsx-a11y": "^6.10.0",
42
- "eslint-plugin-lodash": "^7.4.0",
40
+ "eslint-plugin-jest": "^28.11.0",
41
+ "eslint-plugin-jsx-a11y": "^6.10.2",
42
+ "eslint-plugin-lodash": "^8.0.0",
43
43
  "eslint-plugin-no-snapshot-testing": "^1.0.61",
44
- "eslint-plugin-react": "^7.37.1",
45
- "eslint-plugin-react-hooks": "^4.6.2"
44
+ "eslint-plugin-react": "^7.37.4",
45
+ "eslint-plugin-react-hooks": "^5.1.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "eslint": "^8.57.1"
48
+ "eslint": "^9.18.0"
49
49
  }
50
50
  }