@mikey-pro/eslint-config 4.4.0 → 4.6.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.js +56 -95
  2. package/package.json +9 -9
package/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  module.exports = {
2
2
  extends: [
3
3
  'eslint:recommended',
4
+ 'react-app',
5
+ 'react-app/jest',
4
6
  'plugin:unicorn/all',
5
7
  'plugin:sonarjs/recommended',
6
8
  'plugin:compat/recommended',
@@ -10,9 +12,22 @@ module.exports = {
10
12
  overrides: [
11
13
  {
12
14
  files: ['*.ts'],
15
+ parser: '@typescript-eslint/parser',
13
16
  parserOptions: {
17
+ tsconfigRootDir: __dirname,
18
+ project: ['../../../tsconfig.json'],
14
19
  extraFileExtensions: ['.vue', '.svelte'],
20
+ sourceType: 'module',
21
+ ecmaVersion: 'latest',
22
+ ecmaFeatures: {
23
+ jsx: true,
24
+ },
15
25
  },
26
+ plugins: ['@typescript-eslint'],
27
+ extends: [
28
+ 'plugin:@typescript-eslint/recommended',
29
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
30
+ ],
16
31
  rules: {
17
32
  'import/named': 0,
18
33
  'import/namespace': 0,
@@ -25,8 +40,7 @@ module.exports = {
25
40
  },
26
41
  },
27
42
  {
28
- files: ['*.tsx'],
29
- extends: ['react-app', 'react-app/jest'],
43
+ files: ['*.tsx', '*.jsx'],
30
44
  parserOptions: {
31
45
  extraFileExtensions: ['.vue', '.svelte'],
32
46
  },
@@ -38,40 +52,6 @@ module.exports = {
38
52
  'import/no-unresolved': 0,
39
53
  '@typescript-eslint/naming-convention': 0,
40
54
  '@typescript-eslint/indent': 0,
41
- 'react/state-in-constructor': 0,
42
- 'react/no-deprecated': 1,
43
- 'react/react-in-jsx-scope': 0,
44
- 'react/display-name': [1, { ignoreTranspilerName: false }],
45
- 'react/jsx-no-bind': [
46
- 1,
47
- {
48
- ignoreRefs: true,
49
- allowFunctions: true,
50
- allowArrowFunctions: true,
51
- },
52
- ],
53
- 'react/no-string-refs': 1,
54
- 'react/no-find-dom-node': 1,
55
- 'react/jsx-no-comment-textnodes': 1,
56
- 'react/jsx-curly-spacing': 1,
57
- 'react/jsx-no-undef': 1,
58
- 'react/jsx-uses-react': 1,
59
- 'react/jsx-uses-vars': 1,
60
- 'react/function-component-definition': 0,
61
- 'react/jsx-no-duplicate-props': 1,
62
- 'react/jsx-no-target-blank': 1,
63
- 'react/jsx-tag-spacing': [1, { beforeSelfClosing: 'always' }],
64
- 'react/jsx-key': [1, { checkFragmentShorthand: true }],
65
- 'react/self-closing-comp': 1,
66
- 'react/prefer-es6-class': 1,
67
- 'react/prefer-stateless-function': 1,
68
- 'react/require-render-return': 1,
69
- 'react/no-danger': 1,
70
- 'react/no-did-mount-set-state': 1,
71
- 'react/no-did-update-set-state': 1,
72
- 'react/no-is-mounted': 1,
73
- 'react-hooks/rules-of-hooks': 1,
74
- 'react-hooks/exhaustive-deps': 1,
75
55
  'prettier/prettier': [1, { parser: 'typescript' }],
76
56
  },
77
57
  },
@@ -109,65 +89,6 @@ module.exports = {
109
89
  'prettier/prettier': 0,
110
90
  },
111
91
  },
112
- {
113
- files: ['*.jsx'],
114
- extends: ['react-app', 'react-app/jest'],
115
- parser: '@babel/eslint-parser',
116
- parserOptions: {
117
- requireConfigFile: false,
118
- ecmaVersion: 'latest',
119
- sourceType: 'module',
120
- babelOptions: {
121
- presets: [
122
- [
123
- '@babel/preset-env',
124
- {
125
- targets: {
126
- node: 'current',
127
- },
128
- },
129
- ],
130
- '@babel/preset-react',
131
- ],
132
- },
133
- },
134
- rules: {
135
- 'react/no-deprecated': 1,
136
- 'react/react-in-jsx-scope': 0,
137
- 'react/display-name': [1, { ignoreTranspilerName: false }],
138
- 'react/jsx-no-bind': [
139
- 1,
140
- {
141
- ignoreRefs: true,
142
- allowFunctions: true,
143
- allowArrowFunctions: true,
144
- },
145
- ],
146
- 'react/no-string-refs': 1,
147
- 'react/no-find-dom-node': 1,
148
- 'react/jsx-no-comment-textnodes': 1,
149
- 'react/jsx-curly-spacing': 1,
150
- 'react/jsx-no-undef': 1,
151
- 'react/jsx-uses-react': 1,
152
- 'react/jsx-uses-vars': 1,
153
- 'react/function-component-definition': 0,
154
- 'react/state-in-constructor': 0,
155
- 'react/jsx-no-duplicate-props': 1,
156
- 'react/jsx-no-target-blank': 1,
157
- 'react/jsx-tag-spacing': [1, { beforeSelfClosing: 'always' }],
158
- 'react/jsx-key': [1, { checkFragmentShorthand: true }],
159
- 'react/self-closing-comp': 1,
160
- 'react/prefer-es6-class': 1,
161
- 'react/prefer-stateless-function': 1,
162
- 'react/require-render-return': 1,
163
- 'react/no-danger': 1,
164
- 'react/no-did-mount-set-state': 1,
165
- 'react/no-did-update-set-state': 1,
166
- 'react/no-is-mounted': 1,
167
- 'react-hooks/rules-of-hooks': 1,
168
- 'react-hooks/exhaustive-deps': 1,
169
- },
170
- },
171
92
  {
172
93
  files: ['*.md'],
173
94
  parser: 'markdown-eslint-parser',
@@ -437,6 +358,46 @@ module.exports = {
437
358
  ignore: ['README.md'],
438
359
  },
439
360
  ],
361
+ 'react/state-in-constructor': 0,
362
+ 'react/no-deprecated': 1,
363
+ 'react/react-in-jsx-scope': 0,
364
+ 'react/display-name': [1, { ignoreTranspilerName: false }],
365
+ 'react/jsx-no-bind': [
366
+ 1,
367
+ {
368
+ ignoreRefs: true,
369
+ allowFunctions: true,
370
+ allowArrowFunctions: true,
371
+ },
372
+ ],
373
+ 'react/no-string-refs': 1,
374
+ 'react/no-find-dom-node': 1,
375
+ 'react/jsx-no-comment-textnodes': 1,
376
+ 'react/jsx-curly-spacing': 1,
377
+ 'react/jsx-no-undef': 1,
378
+ 'react/jsx-uses-react': 1,
379
+ 'react/jsx-uses-vars': 1,
380
+ 'react/function-component-definition': 0,
381
+ 'react/jsx-no-duplicate-props': 1,
382
+ 'react/jsx-no-target-blank': 1,
383
+ 'react/jsx-tag-spacing': [1, { beforeSelfClosing: 'always' }],
384
+ 'react/jsx-key': [1, { checkFragmentShorthand: true }],
385
+ 'react/prefer-es6-class': 1,
386
+ 'react/prefer-stateless-function': 1,
387
+ 'react/require-render-return': 1,
388
+ 'react/no-danger': 1,
389
+ 'react/no-did-mount-set-state': 1,
390
+ 'react/no-did-update-set-state': 1,
391
+ 'react/no-is-mounted': 1,
392
+ 'react-hooks/rules-of-hooks': 1,
393
+ 'react-hooks/exhaustive-deps': 1,
394
+ 'react/self-closing-comp': [
395
+ 'error',
396
+ {
397
+ component: true,
398
+ html: false,
399
+ },
400
+ ],
440
401
  'prettier/prettier': [1, { parser: 'babel' }],
441
402
  },
442
403
  plugins: [
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@mikey-pro/eslint-config",
3
- "version": "4.4.0",
3
+ "version": "4.6.0",
4
4
  "description": "Mikey Pro ESLint configuration",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
- "@babel/core": "^7.16.10",
8
- "@babel/eslint-parser": "^7.16",
7
+ "@babel/core": "^7.17.4",
8
+ "@babel/eslint-parser": "^7.17",
9
9
  "@babel/eslint-plugin": "^7.16",
10
- "@babel/plugin-transform-react-jsx": "^7.16.7",
10
+ "@babel/plugin-transform-react-jsx": "^7.17.3",
11
11
  "@babel/preset-env": "^7.16",
12
12
  "@html-eslint/eslint-plugin": "^0.13.1",
13
13
  "@html-eslint/parser": "^0.13.1",
14
- "@typescript-eslint/eslint-plugin": "^5.10.0",
15
- "@typescript-eslint/parser": "^5.10.0",
14
+ "@typescript-eslint/eslint-plugin": "^5.12.0",
15
+ "@typescript-eslint/parser": "^5.12.0",
16
16
  "@vue/babel-plugin-jsx": "^1.1.1",
17
17
  "eslint-config-prettier": "^8.3",
18
18
  "eslint-config-react-app": "^7.0.0",
@@ -21,7 +21,7 @@
21
21
  "eslint-plugin-css-modules": "^2.11",
22
22
  "eslint-plugin-disable-autofix": "^0.1.6",
23
23
  "eslint-plugin-json-format": "^2.0",
24
- "eslint-plugin-jsonc": "^2.0.0",
24
+ "eslint-plugin-jsonc": "^2.1.0",
25
25
  "eslint-plugin-md": "^1.0",
26
26
  "eslint-plugin-node": "^11.1.0",
27
27
  "eslint-plugin-only-warn": "^1.0.3",
@@ -31,9 +31,9 @@
31
31
  "eslint-plugin-svelte3": "^3.4.0",
32
32
  "eslint-plugin-toml": "^0.3.0",
33
33
  "eslint-plugin-unicorn": "^40.1.0",
34
- "eslint-plugin-vue": "^8.3",
34
+ "eslint-plugin-vue": "^8.4",
35
35
  "eslint-plugin-yaml": "^0.5.0",
36
- "vue-eslint-parser": "^8.0"
36
+ "vue-eslint-parser": "^8.2"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "eslint": ">=8.3.0"