@mikey-pro/eslint-config 4.8.1 → 4.8.4

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