@mikey-pro/eslint-config 4.3.2 → 4.5.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 +25 -64
  2. package/package.json +8 -7
package/index.js CHANGED
@@ -10,9 +10,22 @@ module.exports = {
10
10
  overrides: [
11
11
  {
12
12
  files: ['*.ts'],
13
+ parser: '@typescript-eslint/parser',
13
14
  parserOptions: {
15
+ tsconfigRootDir: __dirname,
16
+ project: ['../../../tsconfig.json'],
14
17
  extraFileExtensions: ['.vue', '.svelte'],
18
+ sourceType: 'module',
19
+ ecmaVersion: 'latest',
20
+ ecmaFeatures: {
21
+ jsx: true,
22
+ },
15
23
  },
24
+ plugins: ['@typescript-eslint'],
25
+ extends: [
26
+ 'plugin:@typescript-eslint/recommended',
27
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
28
+ ],
16
29
  rules: {
17
30
  'import/named': 0,
18
31
  'import/namespace': 0,
@@ -25,7 +38,7 @@ module.exports = {
25
38
  },
26
39
  },
27
40
  {
28
- files: ['*.tsx'],
41
+ files: ['*.tsx', '*.jsx'],
29
42
  extends: ['react-app', 'react-app/jest'],
30
43
  parserOptions: {
31
44
  extraFileExtensions: ['.vue', '.svelte'],
@@ -62,7 +75,6 @@ module.exports = {
62
75
  'react/jsx-no-target-blank': 1,
63
76
  'react/jsx-tag-spacing': [1, { beforeSelfClosing: 'always' }],
64
77
  'react/jsx-key': [1, { checkFragmentShorthand: true }],
65
- 'react/self-closing-comp': 1,
66
78
  'react/prefer-es6-class': 1,
67
79
  'react/prefer-stateless-function': 1,
68
80
  'react/require-render-return': 1,
@@ -72,6 +84,13 @@ module.exports = {
72
84
  'react/no-is-mounted': 1,
73
85
  'react-hooks/rules-of-hooks': 1,
74
86
  'react-hooks/exhaustive-deps': 1,
87
+ 'react/self-closing-comp': [
88
+ 'error',
89
+ {
90
+ component: true,
91
+ html: false,
92
+ },
93
+ ],
75
94
  'prettier/prettier': [1, { parser: 'typescript' }],
76
95
  },
77
96
  },
@@ -109,65 +128,6 @@ module.exports = {
109
128
  'prettier/prettier': 0,
110
129
  },
111
130
  },
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
131
  {
172
132
  files: ['*.md'],
173
133
  parser: 'markdown-eslint-parser',
@@ -296,7 +256,7 @@ module.exports = {
296
256
  node: true,
297
257
  es6: true,
298
258
  commonjs: true,
299
- es2022: true,
259
+ es2021: true,
300
260
  },
301
261
  rules: {
302
262
  'no-restricted-syntax': [
@@ -336,9 +296,9 @@ module.exports = {
336
296
  'newlines-between': 'always',
337
297
  },
338
298
  ],
339
- 'import/extensions': ['error', 'never', { ignorePackages: true }],
299
+ 'import/extensions': [1, 'never', { ignorePackages: true }],
340
300
  'prefer-destructuring': [
341
- 'error',
301
+ 1,
342
302
  {
343
303
  object: true,
344
304
  array: false,
@@ -446,6 +406,7 @@ module.exports = {
446
406
  '@babel',
447
407
  'unicorn',
448
408
  'sonarjs',
409
+ 'only-warn',
449
410
  ],
450
411
  ignorePatterns: [
451
412
  '!.*',
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@mikey-pro/eslint-config",
3
- "version": "4.3.2",
3
+ "version": "4.5.0",
4
4
  "description": "Mikey Pro ESLint configuration",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
- "@babel/core": "^7.16.10",
7
+ "@babel/core": "^7.16.12",
8
8
  "@babel/eslint-parser": "^7.16",
9
9
  "@babel/eslint-plugin": "^7.16",
10
10
  "@babel/plugin-transform-react-jsx": "^7.16.7",
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.10.1",
15
+ "@typescript-eslint/parser": "^5.10.1",
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,18 +21,19 @@
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
+ "eslint-plugin-only-warn": "^1.0.3",
27
28
  "eslint-plugin-prettier": "^4.0",
28
29
  "eslint-plugin-promise": "^6.0.0",
29
30
  "eslint-plugin-sonarjs": "^0.11.0",
30
31
  "eslint-plugin-svelte3": "^3.4.0",
31
32
  "eslint-plugin-toml": "^0.3.0",
32
33
  "eslint-plugin-unicorn": "^40.1.0",
33
- "eslint-plugin-vue": "^8.3",
34
+ "eslint-plugin-vue": "^8.4",
34
35
  "eslint-plugin-yaml": "^0.5.0",
35
- "vue-eslint-parser": "^8.0"
36
+ "vue-eslint-parser": "^8.2"
36
37
  },
37
38
  "peerDependencies": {
38
39
  "eslint": ">=8.3.0"