eslint-config-adslot 1.9.0 → 2.0.1

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