@mikey-pro/eslint-config 2.5.5 → 3.1.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.cjs +143 -53
  2. package/package.json +4 -3
package/index.cjs CHANGED
@@ -9,11 +9,103 @@ module.exports = {
9
9
  'plugin:sonarjs/recommended',
10
10
  'plugin:compat/recommended',
11
11
  'plugin:css-modules/recommended',
12
- 'plugin:react/recommended',
13
- 'plugin:react-hooks/recommended',
14
12
  'plugin:prettier/recommended',
15
13
  ],
16
14
  overrides: [
15
+ {
16
+ files: ['*.css'],
17
+ rules: {
18
+ 'prettier/prettier': [2, { parser: 'css' }],
19
+ },
20
+ },
21
+ {
22
+ files: ['*.scss'],
23
+ rules: {
24
+ 'prettier/prettier': [2, { parser: 'scss' }],
25
+ },
26
+ },
27
+ {
28
+ files: ['*.less'],
29
+ rules: {
30
+ 'prettier/prettier': [2, { parser: 'less' }],
31
+ },
32
+ },
33
+ {
34
+ files: ['*.yaml', '*.yml'],
35
+ plugins: ['yaml'],
36
+ extends: ['plugin:yaml/recommended'],
37
+ rules: {
38
+ 'prettier/prettier': [2, { parser: 'yaml' }],
39
+ },
40
+ },
41
+ {
42
+ files: ['*.toml'],
43
+ parser: 'toml-eslint-parser',
44
+ extends: ['plugin:toml/standard'],
45
+ rules: {
46
+ 'prettier/prettier': [2],
47
+ },
48
+ },
49
+ {
50
+ files: ['*.jsx'],
51
+ extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
52
+ plugins: ['react', 'react-hooks'],
53
+ parser: '@babel/eslint-parser',
54
+ parserOptions: {
55
+ requireConfigFile: false,
56
+ ecmaVersion: 'latest',
57
+ sourceType: 'module',
58
+ babelOptions: {
59
+ presets: [
60
+ [
61
+ '@babel/preset-env',
62
+ {
63
+ targets: {
64
+ node: 'current',
65
+ },
66
+ },
67
+ ],
68
+ '@babel/preset-react',
69
+ 'airbnb',
70
+ ],
71
+ },
72
+ },
73
+ rules: {
74
+ 'react/no-deprecated': 2,
75
+ 'react/react-in-jsx-scope': 0,
76
+ 'react/display-name': [1, { ignoreTranspilerName: false }],
77
+ 'react/jsx-no-bind': [
78
+ 1,
79
+ {
80
+ ignoreRefs: true,
81
+ allowFunctions: true,
82
+ allowArrowFunctions: true,
83
+ },
84
+ ],
85
+ 'react/function-component-definition': 0,
86
+ 'react/state-in-constructor': 0,
87
+ 'react/jsx-no-comment-textnodes': 2,
88
+ 'react/jsx-no-duplicate-props': 2,
89
+ 'react/jsx-no-target-blank': 2,
90
+ 'react/jsx-no-undef': 2,
91
+ 'react/jsx-tag-spacing': [2, { beforeSelfClosing: 'always' }],
92
+ 'react/jsx-uses-react': 2,
93
+ 'react/jsx-uses-vars': 2,
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-find-dom-node': 2,
103
+ 'react/no-is-mounted': 2,
104
+ 'react/no-string-refs': 2,
105
+ 'react-hooks/rules-of-hooks': 2,
106
+ 'react-hooks/exhaustive-deps': 1,
107
+ },
108
+ },
17
109
  {
18
110
  files: ['*.md'],
19
111
  parser: 'markdown-eslint-parser',
@@ -41,6 +133,7 @@ module.exports = {
41
133
  files: ['*.html'],
42
134
  parser: '@html-eslint/parser',
43
135
  extends: ['plugin:@html-eslint/recommended'],
136
+ plugins: ['@html-eslint'],
44
137
  rules: {
45
138
  'spaced-comment': 0,
46
139
  '@html-eslint/indent': 0,
@@ -57,6 +150,34 @@ module.exports = {
57
150
  files: ['*.vue'],
58
151
  parser: 'vue-eslint-parser',
59
152
  extends: ['plugin:vue/vue3-recommended', '@vue/airbnb'],
153
+ parser: '@babel/eslint-parser',
154
+ parserOptions: {
155
+ requireConfigFile: false,
156
+ ecmaVersion: 'latest',
157
+ sourceType: 'module',
158
+ babelOptions: {
159
+ presets: [
160
+ [
161
+ '@babel/preset-env',
162
+ {
163
+ targets: {
164
+ node: 'current',
165
+ },
166
+ },
167
+ ],
168
+ ],
169
+ plugins: [
170
+ '@vue/babel-plugin-jsx',
171
+ [
172
+ '@babel/plugin-transform-react-jsx',
173
+ {
174
+ pragma: 'h',
175
+ pragmaFrag: 'Fragment',
176
+ },
177
+ ],
178
+ ],
179
+ },
180
+ },
60
181
  rules: {
61
182
  'vue/html-self-closing': [
62
183
  2,
@@ -70,12 +191,13 @@ module.exports = {
70
191
  math: 'always',
71
192
  },
72
193
  ],
73
- 'prettier/prettier': 0,
194
+ 'prettier/prettier': [2, { parser: 'vue' }],
74
195
  },
75
196
  },
76
197
  {
77
198
  files: ['*.svelte'],
78
199
  processor: 'svelte3/svelte3',
200
+ plugins: ['svelte3'],
79
201
  rules: {
80
202
  'import/first': 0,
81
203
  'import/no-duplicates': 0,
@@ -84,6 +206,23 @@ module.exports = {
84
206
  'prettier/prettier': 0,
85
207
  },
86
208
  },
209
+ {
210
+ files: ['*.json', '*.jsonc', '*rc'],
211
+ extends: ['plugin:jsonc/all'],
212
+ parser: 'jsonc-eslint-parser',
213
+ plugins: ['json-format'],
214
+ rules: {
215
+ 'prettier/prettier': [2, { parser: 'json' }],
216
+ },
217
+ },
218
+ {
219
+ files: ['*.json5'],
220
+ extends: ['plugin:jsonc/all'],
221
+ parser: 'jsonc-eslint-parser',
222
+ rules: {
223
+ 'prettier/prettier': [2, { parser: 'json5' }],
224
+ },
225
+ },
87
226
  ],
88
227
  env: {
89
228
  browser: true,
@@ -214,39 +353,6 @@ module.exports = {
214
353
  },
215
354
  },
216
355
  ],
217
- 'react/no-deprecated': 2,
218
- 'react/react-in-jsx-scope': 0,
219
- 'react/display-name': [1, { ignoreTranspilerName: false }],
220
- 'react/jsx-no-bind': [
221
- 1,
222
- {
223
- ignoreRefs: true,
224
- allowFunctions: true,
225
- allowArrowFunctions: true,
226
- },
227
- ],
228
- 'react/function-component-definition': 0,
229
- 'react/state-in-constructor': 0,
230
- 'react/jsx-no-comment-textnodes': 2,
231
- 'react/jsx-no-duplicate-props': 2,
232
- 'react/jsx-no-target-blank': 2,
233
- 'react/jsx-no-undef': 2,
234
- 'react/jsx-tag-spacing': [2, { beforeSelfClosing: 'always' }],
235
- 'react/jsx-uses-react': 2,
236
- 'react/jsx-uses-vars': 2,
237
- 'react/jsx-key': [2, { checkFragmentShorthand: true }],
238
- 'react/self-closing-comp': 2,
239
- 'react/prefer-es6-class': 2,
240
- 'react/prefer-stateless-function': 1,
241
- 'react/require-render-return': 2,
242
- 'react/no-danger': 1,
243
- 'react/no-did-mount-set-state': 2,
244
- 'react/no-did-update-set-state': 2,
245
- 'react/no-find-dom-node': 2,
246
- 'react/no-is-mounted': 2,
247
- 'react/no-string-refs': 2,
248
- 'react-hooks/rules-of-hooks': 2,
249
- 'react-hooks/exhaustive-deps': 1,
250
356
  'unicorn/import-index': [2, { ignoreImports: true }],
251
357
  'filenames/match-regex': 0,
252
358
  'unicorn/filename-case': [
@@ -259,20 +365,15 @@ module.exports = {
259
365
  ignore: ['README.md'],
260
366
  },
261
367
  ],
262
- 'prettier/prettier': [2],
368
+ 'prettier/prettier': [2, { parser: 'babel' }],
263
369
  },
264
370
  plugins: [
265
371
  'import',
266
372
  'prettier',
267
- 'json-format',
268
373
  'css-modules',
269
- '@html-eslint',
270
374
  'disable-autofix',
271
375
  '@babel',
272
- 'react',
273
- 'react-hooks',
274
376
  'unicorn',
275
- 'svelte3',
276
377
  'sonarjs',
277
378
  'github',
278
379
  ],
@@ -305,19 +406,8 @@ module.exports = {
305
406
  },
306
407
  },
307
408
  ],
308
- '@babel/preset-react',
309
409
  'airbnb',
310
410
  ],
311
- plugins: [
312
- '@vue/babel-plugin-jsx',
313
- [
314
- '@babel/plugin-transform-react-jsx',
315
- {
316
- pragma: 'h',
317
- pragmaFrag: 'Fragment',
318
- },
319
- ],
320
- ],
321
411
  },
322
412
  },
323
413
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikey-pro/eslint-config",
3
- "version": "2.5.5",
3
+ "version": "3.1.0",
4
4
  "description": "Mikey Pro ESLint configuration",
5
5
  "main": "index.cjs",
6
6
  "dependencies": {
@@ -17,14 +17,13 @@
17
17
  "eslint-config-airbnb": "^19.0",
18
18
  "eslint-config-prettier": "^8.3",
19
19
  "eslint-config-standard": "^16.0.3",
20
- "eslint-import-resolver-alias": "^1.1",
21
20
  "eslint-plugin-compat": "^4.0",
22
21
  "eslint-plugin-css-modules": "^2.11",
23
22
  "eslint-plugin-disable-autofix": "^0.1.6",
24
23
  "eslint-plugin-github": "^4.3.5",
25
24
  "eslint-plugin-import": "^2.25",
26
- "eslint-plugin-json": "^3.1",
27
25
  "eslint-plugin-json-format": "^2.0",
26
+ "eslint-plugin-jsonc": "^2.0.0",
28
27
  "eslint-plugin-jsx-a11y": "^6.5",
29
28
  "eslint-plugin-md": "^1.0",
30
29
  "eslint-plugin-node": "^11.1.0",
@@ -34,8 +33,10 @@
34
33
  "eslint-plugin-react-hooks": "^4.3",
35
34
  "eslint-plugin-sonarjs": "^0.10.0",
36
35
  "eslint-plugin-svelte3": "^3.2.1",
36
+ "eslint-plugin-toml": "^0.3.0",
37
37
  "eslint-plugin-unicorn": "^39.0.0",
38
38
  "eslint-plugin-vue": "^8.1",
39
+ "eslint-plugin-yaml": "^0.5.0",
39
40
  "vue-eslint-parser": "^8.0"
40
41
  },
41
42
  "peerDependencies": {