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