@mikey-pro/eslint-config 4.8.1 → 4.8.2

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 +191 -191
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,4 +1,11 @@
1
1
  module.exports = {
2
+ env: {
3
+ browser: true,
4
+ commonjs: true,
5
+ es2021: true,
6
+ es6: true,
7
+ node: true,
8
+ },
2
9
  extends: [
3
10
  'eslint:recommended',
4
11
  'react-app',
@@ -9,33 +16,44 @@ module.exports = {
9
16
  'plugin:css-modules/recommended',
10
17
  'plugin:prettier/recommended',
11
18
  ],
19
+ ignorePatterns: [
20
+ '!.*',
21
+ 'node_modules',
22
+ 'vendor',
23
+ 'dist',
24
+ 'package-lock.json',
25
+ 'LICENSE',
26
+ '.vscode',
27
+ '.github',
28
+ 'tsconfig.json',
29
+ ],
12
30
  overrides: [
13
31
  {
32
+ extends: [
33
+ 'plugin:@typescript-eslint/recommended',
34
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
35
+ ],
14
36
  files: ['*.ts', '*.tsx'],
15
37
  parser: '@typescript-eslint/parser',
16
38
  parserOptions: {
17
- tsconfigRootDir: __dirname,
18
- project: ['../../../tsconfig.json'],
19
- extraFileExtensions: ['.vue', '.svelte'],
20
- sourceType: 'module',
21
- ecmaVersion: 'latest',
22
39
  ecmaFeatures: {
23
40
  jsx: true,
24
41
  },
42
+ ecmaVersion: 'latest',
43
+ extraFileExtensions: ['.vue', '.svelte'],
44
+ project: ['../../../tsconfig.json'],
45
+ sourceType: 'module',
46
+ tsconfigRootDir: __dirname,
25
47
  },
26
48
  plugins: ['@typescript-eslint'],
27
- extends: [
28
- 'plugin:@typescript-eslint/recommended',
29
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
30
- ],
31
49
  rules: {
50
+ '@typescript-eslint/indent': 1,
51
+ '@typescript-eslint/naming-convention': 1,
52
+ 'import/default': 1,
32
53
  'import/named': 1,
33
54
  'import/namespace': 1,
34
- 'import/default': 1,
35
55
  'import/no-named-as-default-member': 1,
36
56
  'import/no-unresolved': 1,
37
- '@typescript-eslint/indent': 1,
38
- '@typescript-eslint/naming-convention': 1,
39
57
  'prettier/prettier': [1, { parser: 'typescript' }],
40
58
  },
41
59
  },
@@ -58,25 +76,25 @@ module.exports = {
58
76
  },
59
77
  },
60
78
  {
79
+ extends: ['plugin:yaml/recommended'],
61
80
  files: ['*.yaml', '*.yml'],
62
81
  plugins: ['yaml'],
63
- extends: ['plugin:yaml/recommended'],
64
82
  rules: {
65
83
  'prettier/prettier': [1, { parser: 'yaml' }],
66
84
  },
67
85
  },
68
86
  {
87
+ extends: ['plugin:toml/standard'],
69
88
  files: ['*.toml'],
70
89
  parser: 'toml-eslint-parser',
71
- extends: ['plugin:toml/standard'],
72
90
  rules: {
73
91
  'prettier/prettier': 1,
74
92
  },
75
93
  },
76
94
  {
95
+ extends: ['plugin:md/recommended'],
77
96
  files: ['*.md'],
78
97
  parser: 'markdown-eslint-parser',
79
- extends: ['plugin:md/recommended'],
80
98
  rules: {
81
99
  'md/remark': [
82
100
  1,
@@ -97,12 +115,11 @@ module.exports = {
97
115
  },
98
116
  },
99
117
  {
118
+ extends: ['plugin:@html-eslint/recommended'],
100
119
  files: ['*.html'],
101
120
  parser: '@html-eslint/parser',
102
- extends: ['plugin:@html-eslint/recommended'],
103
121
  plugins: ['@html-eslint'],
104
122
  rules: {
105
- 'spaced-comment': 1,
106
123
  '@html-eslint/indent': 1,
107
124
  '@html-eslint/no-extra-spacing-attrs': 1,
108
125
  '@html-eslint/require-closing-tags': 1,
@@ -111,27 +128,15 @@ module.exports = {
111
128
  { selfClosing: 'always' },
112
129
  ],
113
130
  'prettier/prettier': [1, { parser: 'html' }],
131
+ 'spaced-comment': 1,
114
132
  },
115
133
  },
116
134
  {
135
+ extends: ['plugin:vue/vue3-recommended'],
117
136
  files: ['*.vue'],
118
137
  parser: 'vue-eslint-parser',
119
- extends: ['plugin:vue/vue3-recommended'],
120
138
  parserOptions: {
121
- requireConfigFile: false,
122
- ecmaVersion: 'latest',
123
- sourceType: 'module',
124
139
  babelOptions: {
125
- presets: [
126
- [
127
- '@babel/preset-env',
128
- {
129
- targets: {
130
- node: 'current',
131
- },
132
- },
133
- ],
134
- ],
135
140
  plugins: [
136
141
  'eslint-plugin-vue',
137
142
  [
@@ -142,34 +147,47 @@ module.exports = {
142
147
  },
143
148
  ],
144
149
  ],
150
+ presets: [
151
+ [
152
+ '@babel/preset-env',
153
+ {
154
+ targets: {
155
+ node: 'current',
156
+ },
157
+ },
158
+ ],
159
+ ],
145
160
  },
161
+ ecmaVersion: 'latest',
162
+ requireConfigFile: false,
163
+ sourceType: 'module',
146
164
  },
147
165
  rules: {
166
+ 'prettier/prettier': 1,
167
+ 'vue/component-tags-order': [
168
+ 1,
169
+ {
170
+ order: [['script', 'template'], 'style'],
171
+ },
172
+ ],
148
173
  'vue/html-self-closing': [
149
174
  1,
150
175
  {
151
176
  html: {
152
- void: 'always',
153
- normal: 'always',
154
177
  component: 'always',
178
+ normal: 'always',
179
+ void: 'always',
155
180
  },
156
- svg: 'always',
157
181
  math: 'always',
182
+ svg: 'always',
158
183
  },
159
184
  ],
160
- 'vue/component-tags-order': [
161
- 1,
162
- {
163
- order: [['script', 'template'], 'style'],
164
- },
165
- ],
166
- 'prettier/prettier': 1,
167
185
  },
168
186
  },
169
187
  {
170
188
  files: ['*.svelte'],
171
- processor: 'svelte3/svelte3',
172
189
  plugins: ['svelte3'],
190
+ processor: 'svelte3/svelte3',
173
191
  rules: {
174
192
  'import/first': 1,
175
193
  'import/no-duplicates': 1,
@@ -179,8 +197,8 @@ module.exports = {
179
197
  },
180
198
  },
181
199
  {
182
- files: ['*.json', '*.jsonc', '*rc'],
183
200
  extends: ['plugin:jsonc/recommended-with-json'],
201
+ files: ['*.json', '*.jsonc', '*rc'],
184
202
  parser: 'jsonc-eslint-parser',
185
203
  plugins: ['json-format'],
186
204
  rules: {
@@ -188,49 +206,56 @@ module.exports = {
188
206
  },
189
207
  },
190
208
  {
191
- files: ['*.json5'],
192
209
  extends: ['plugin:jsonc/recommended-with-json5'],
210
+ files: ['*.json5'],
193
211
  parser: 'jsonc-eslint-parser',
194
212
  rules: {
195
213
  'prettier/prettier': [1, { parser: 'json5' }],
196
214
  },
197
215
  },
198
216
  ],
199
- env: {
200
- browser: true,
201
- node: true,
202
- es6: true,
203
- commonjs: true,
204
- es2021: true,
217
+ parser: '@babel/eslint-parser',
218
+ parserOptions: {
219
+ babelOptions: {
220
+ presets: [
221
+ [
222
+ '@babel/preset-env',
223
+ {
224
+ targets: {
225
+ node: 'current',
226
+ },
227
+ },
228
+ ],
229
+ '@babel/preset-react',
230
+ ],
231
+ },
232
+ ecmaVersion: 'latest',
233
+ requireConfigFile: false,
234
+ sourceType: 'module',
205
235
  },
236
+ plugins: [
237
+ 'prettier',
238
+ 'css-modules',
239
+ 'disable-autofix',
240
+ '@babel',
241
+ 'unicorn',
242
+ 'sonarjs',
243
+ 'only-warn',
244
+ 'sort-keys-fix',
245
+ ],
246
+ root: true,
206
247
  rules: {
207
- 'no-restricted-syntax': [
208
- 1,
209
- {
210
- selector: 'ForInStatement',
211
- message:
212
- 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
213
- },
214
- {
215
- selector: 'LabeledStatement',
216
- message:
217
- 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
218
- },
219
- {
220
- selector: 'WithStatement',
221
- message:
222
- '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
223
- },
224
- ],
225
248
  camelcase: 1,
226
- 'no-console': 1,
227
- 'func-names': 1,
228
- 'no-process-exit': 1,
229
249
  'class-methods-use-this': 1,
230
- 'no-underscore-dangle': 1,
250
+ 'constructor-super': 1,
251
+ 'dot-notation': 1,
252
+ 'filenames/match-regex': 1,
253
+ 'func-names': 1,
254
+ 'import/extensions': [1, 'never', { ignorePackages: true }],
255
+ 'import/no-commonjs': 1,
231
256
  'import/no-unresolved': [
232
257
  1,
233
- { commonjs: true, amd: true, ignore: ['^node:'] },
258
+ { amd: true, commonjs: true, ignore: ['^node:'] },
234
259
  ],
235
260
  'import/order': [
236
261
  1,
@@ -241,41 +266,55 @@ module.exports = {
241
266
  'newlines-between': 'always',
242
267
  },
243
268
  ],
244
- 'import/extensions': [1, 'never', { ignorePackages: true }],
245
- 'prefer-destructuring': [
246
- 1,
247
- {
248
- object: true,
249
- array: false,
250
- },
251
- ],
269
+ 'jsx-quotes': 1,
252
270
  'keyword-spacing': 1,
253
- 'require-atomic-updates': 1,
254
- 'import/no-commonjs': 1,
255
- 'sort-imports': 1,
256
- 'constructor-super': 1,
257
271
  'no-caller': 1,
272
+ 'no-confusing-arrow': 1,
273
+ 'no-console': 1,
258
274
  'no-const-assign': 1,
259
275
  'no-delete-var': 1,
260
276
  'no-dupe-class-members': 1,
261
277
  'no-dupe-keys': 1,
262
278
  'no-duplicate-imports': 1,
263
279
  'no-else-return': 1,
264
- 'no-empty-pattern': 1,
265
280
  'no-empty': 1,
281
+ 'no-empty-pattern': 1,
282
+ 'no-extra-bind': 1,
266
283
  'no-extra-parens': 1,
284
+ 'no-extra-semi': 1,
285
+ 'no-floating-decimal': 1,
267
286
  'no-iterator': 1,
268
287
  'no-lonely-if': 1,
269
288
  'no-mixed-spaces-and-tabs': [1, 'smart-tabs'],
270
289
  'no-multi-str': 1,
271
290
  'no-new-wrappers': 1,
291
+ 'no-process-exit': 1,
272
292
  'no-proto': 1,
273
293
  'no-redeclare': 1,
274
- 'no-shadow-restricted-names': 1,
294
+ 'no-restricted-syntax': [
295
+ 1,
296
+ {
297
+ message:
298
+ 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
299
+ selector: 'ForInStatement',
300
+ },
301
+ {
302
+ message:
303
+ 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
304
+ selector: 'LabeledStatement',
305
+ },
306
+ {
307
+ message:
308
+ '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
309
+ selector: 'WithStatement',
310
+ },
311
+ ],
275
312
  'no-shadow': 1,
313
+ 'no-shadow-restricted-names': 1,
276
314
  'no-spaced-func': 1,
277
315
  'no-this-before-super': 1,
278
316
  'no-undef-init': 1,
317
+ 'no-underscore-dangle': 1,
279
318
  'no-unneeded-ternary': 1,
280
319
  'no-unused-vars': [
281
320
  1,
@@ -290,91 +329,65 @@ module.exports = {
290
329
  'no-useless-constructor': 1,
291
330
  'no-useless-escape': 1,
292
331
  'no-useless-rename': 1,
332
+ 'no-useless-return': 1,
293
333
  'no-var': 1,
294
334
  'no-with': 1,
295
- semi: 1,
296
- strict: [1, 'never'],
297
335
  'object-curly-spacing': [1, 'always'],
298
- 'rest-spread-spacing': 1,
299
- 'space-before-function-paren': [1, 'always'],
300
- 'space-in-parens': [1, 'never'],
301
336
  'object-shorthand': 1,
302
337
  'prefer-arrow-callback': 1,
338
+ 'prefer-destructuring': [
339
+ 1,
340
+ {
341
+ array: false,
342
+ object: true,
343
+ },
344
+ ],
303
345
  'prefer-rest-params': 1,
304
346
  'prefer-spread': 1,
305
347
  'prefer-template': 1,
348
+ 'prettier/prettier': [1, { parser: 'babel' }],
349
+ 'quote-props': [1, 'as-needed'],
306
350
  quotes: [
307
351
  1,
308
352
  'single',
309
353
  {
310
- avoidEscape: true,
311
354
  allowTemplateLiterals: true,
355
+ avoidEscape: true,
312
356
  },
313
357
  ],
314
- 'quote-props': [1, 'as-needed'],
315
358
  radix: 1,
316
- 'unicode-bom': 1,
317
- 'valid-jsdoc': 1,
318
- 'spaced-comment': [
319
- 1,
320
- 'always',
321
- {
322
- line: {
323
- markers: ['/'],
324
- exceptions: ['-', '+'],
325
- },
326
- block: {
327
- markers: ['!'],
328
- exceptions: ['*'],
329
- balanced: true,
330
- },
331
- },
332
- ],
333
- 'unicorn/import-index': [1, { ignoreImports: true }],
334
- 'filenames/match-regex': 1,
335
- 'unicorn/filename-case': [
336
- 1,
337
- {
338
- cases: {
339
- camelCase: true,
340
- pascalCase: true,
341
- },
342
- ignore: ['README.md'],
343
- },
344
- ],
345
- 'react/state-in-constructor': 1,
346
- 'react/no-deprecated': 1,
347
- 'react/react-in-jsx-scope': 1,
359
+ 'react-hooks/exhaustive-deps': 1,
360
+ 'react-hooks/rules-of-hooks': 1,
348
361
  'react/display-name': [1, { ignoreTranspilerName: false }],
362
+ 'react/function-component-definition': 1,
363
+ 'react/jsx-curly-spacing': 1,
364
+ 'react/jsx-key': [1, { checkFragmentShorthand: true }],
349
365
  'react/jsx-no-bind': [
350
366
  1,
351
367
  {
352
- ignoreRefs: true,
353
- allowFunctions: true,
354
368
  allowArrowFunctions: true,
369
+ allowFunctions: true,
370
+ ignoreRefs: true,
355
371
  },
356
372
  ],
357
- 'react/no-string-refs': 1,
358
- 'react/no-find-dom-node': 1,
359
373
  'react/jsx-no-comment-textnodes': 1,
360
- 'react/jsx-curly-spacing': 1,
361
- 'react/jsx-no-undef': 1,
362
- 'react/jsx-uses-react': 1,
363
- 'react/jsx-uses-vars': 1,
364
- 'react/function-component-definition': 1,
365
374
  'react/jsx-no-duplicate-props': 1,
366
375
  'react/jsx-no-target-blank': 1,
376
+ 'react/jsx-no-undef': 1,
367
377
  'react/jsx-tag-spacing': [1, { beforeSelfClosing: 'always' }],
368
- 'react/jsx-key': [1, { checkFragmentShorthand: true }],
369
- 'react/prefer-es6-class': 1,
370
- 'react/prefer-stateless-function': 1,
371
- 'react/require-render-return': 1,
378
+ 'react/jsx-uses-react': 1,
379
+ 'react/jsx-uses-vars': 1,
372
380
  'react/no-danger': 1,
381
+ 'react/no-deprecated': 1,
373
382
  'react/no-did-mount-set-state': 1,
374
383
  'react/no-did-update-set-state': 1,
384
+ 'react/no-find-dom-node': 1,
375
385
  'react/no-is-mounted': 1,
376
- 'react-hooks/rules-of-hooks': 1,
377
- 'react-hooks/exhaustive-deps': 1,
386
+ 'react/no-string-refs': 1,
387
+ 'react/prefer-es6-class': 1,
388
+ 'react/prefer-stateless-function': 1,
389
+ 'react/react-in-jsx-scope': 1,
390
+ 'react/require-render-return': 1,
378
391
  'react/self-closing-comp': [
379
392
  'error',
380
393
  {
@@ -382,64 +395,51 @@ module.exports = {
382
395
  html: false,
383
396
  },
384
397
  ],
398
+ 'react/state-in-constructor': 1,
399
+ 'require-atomic-updates': 1,
400
+ 'rest-spread-spacing': 1,
401
+ semi: 1,
402
+ 'sort-imports': 1,
385
403
  'sort-keys-fix/sort-keys-fix': 1,
386
404
  'sort-vars': 1,
387
- 'no-confusing-arrow': 1,
388
- 'no-extra-bind': 1,
389
- 'no-extra-semi': 1,
390
- 'no-floating-decimal': 1,
391
- 'no-useless-return': 1,
392
- 'dot-notation': 1,
393
- 'prettier/prettier': [1, { parser: 'babel' }],
394
- 'jsx-quotes': 1,
405
+ 'space-before-function-paren': [1, 'always'],
406
+ 'space-in-parens': [1, 'never'],
407
+ 'spaced-comment': [
408
+ 1,
409
+ 'always',
410
+ {
411
+ block: {
412
+ balanced: true,
413
+ exceptions: ['*'],
414
+ markers: ['!'],
415
+ },
416
+ line: {
417
+ exceptions: ['-', '+'],
418
+ markers: ['/'],
419
+ },
420
+ },
421
+ ],
422
+ strict: [1, 'never'],
423
+ 'unicode-bom': 1,
424
+ 'unicorn/filename-case': [
425
+ 1,
426
+ {
427
+ cases: {
428
+ camelCase: true,
429
+ pascalCase: true,
430
+ },
431
+ ignore: ['README.md'],
432
+ },
433
+ ],
434
+ 'unicorn/import-index': [1, { ignoreImports: true }],
435
+ 'valid-jsdoc': 1,
395
436
  },
396
- plugins: [
397
- 'prettier',
398
- 'css-modules',
399
- 'disable-autofix',
400
- '@babel',
401
- 'unicorn',
402
- 'sonarjs',
403
- 'only-warn',
404
- 'sort-keys-fix',
405
- ],
406
- ignorePatterns: [
407
- '!.*',
408
- 'node_modules',
409
- 'vendor',
410
- 'dist',
411
- 'package-lock.json',
412
- 'LICENSE',
413
- '.vscode',
414
- '.github',
415
- 'tsconfig.json',
416
- ],
417
- root: true,
418
437
  settings: {
419
438
  'json/sort-package-json': 'pro',
420
439
  polyfills: ['Promise'],
421
440
  react: {
422
441
  pragma: 'h',
423
- version: 'preact',
424
- },
425
- },
426
- parser: '@babel/eslint-parser',
427
- parserOptions: {
428
- requireConfigFile: false,
429
- ecmaVersion: 'latest',
430
- sourceType: 'module',
431
- babelOptions: {
432
- presets: [
433
- [
434
- '@babel/preset-env',
435
- {
436
- targets: {
437
- node: 'current',
438
- },
439
- },
440
- ],
441
- '@babel/preset-react',
442
- ],
442
+ version: 'detect',
443
443
  },
444
444
  },
445
445
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikey-pro/eslint-config",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "description": "Mikey Pro ESLint configuration",
5
5
  "main": "index.js",
6
6
  "dependencies": {