@st1ggy/linter-config 1.0.47 → 1.0.49
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.
- package/bun.lockb +0 -0
- package/eslint.config.js +3 -1
- package/package.json +1 -1
- package/src/eslint/eslint.config.react.js +35 -36
- package/src/eslint/eslint.config.typescript.js +5 -26
package/bun.lockb
CHANGED
|
Binary file
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
|
|
2
2
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
3
3
|
|
|
4
4
|
import typescript from './eslint.config.typescript.js'
|
|
5
5
|
|
|
6
6
|
export default [
|
|
7
7
|
...typescript,
|
|
8
|
+
reactRecommended,
|
|
9
|
+
// reactHooksPlugin.configs.recommended,
|
|
8
10
|
{
|
|
9
|
-
plugins: {
|
|
10
|
-
react: reactPlugin,
|
|
11
|
-
'react-hooks': reactHooksPlugin,
|
|
12
|
-
},
|
|
11
|
+
plugins: { 'react-hooks': reactHooksPlugin },
|
|
13
12
|
rules: {
|
|
14
|
-
'react/
|
|
15
|
-
'react/
|
|
16
|
-
'react/
|
|
17
|
-
'react/
|
|
18
|
-
'react/
|
|
19
|
-
'react/jsx-props-no-spreading': 'off',
|
|
20
|
-
'react/jsx-filename-extension': 'off',
|
|
21
|
-
'react/destructuring-assignment': 'off',
|
|
22
|
-
'react/static-property-placement': 'off',
|
|
23
|
-
'react/jsx-one-expression-per-line': 'off',
|
|
24
|
-
'react/self-closing-comp': [
|
|
25
|
-
'error',
|
|
26
|
-
{
|
|
27
|
-
component: true,
|
|
28
|
-
html: true,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
'react/default-props-match-prop-types': [
|
|
32
|
-
'warn',
|
|
33
|
-
{
|
|
34
|
-
allowRequiredDefaults: true,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
'react/jsx-wrap-multilines': 'off',
|
|
38
|
-
'react/jsx-indent': 'off',
|
|
39
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
40
|
-
'react-hooks/exhaustive-deps': 'error',
|
|
13
|
+
'react/boolean-prop-naming': 'error',
|
|
14
|
+
'react/button-has-type': 'error',
|
|
15
|
+
'react/checked-requires-onchange-or-readonly': 'error',
|
|
16
|
+
'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
|
|
17
|
+
'react/destructuring-assignment': 'error',
|
|
41
18
|
'react/function-component-definition': [
|
|
42
19
|
'error',
|
|
43
20
|
{
|
|
@@ -45,13 +22,35 @@ export default [
|
|
|
45
22
|
unnamedComponents: 'arrow-function',
|
|
46
23
|
},
|
|
47
24
|
],
|
|
48
|
-
'react/
|
|
49
|
-
|
|
25
|
+
'react/hook-use-state': 'error',
|
|
26
|
+
'react/jsx-boolean-value': 'error',
|
|
27
|
+
'react/jsx-child-element-spacing': 'error',
|
|
28
|
+
'react/jsx-closing-bracket-location': 'error',
|
|
29
|
+
'react/jsx-closing-tag-location': 'error',
|
|
30
|
+
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
|
31
|
+
'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
|
|
32
|
+
'react/jsx-curly-spacing': [
|
|
33
|
+
'error',
|
|
50
34
|
{
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
when: 'never',
|
|
36
|
+
attributes: { allowMultiline: false },
|
|
37
|
+
children: false,
|
|
53
38
|
},
|
|
54
39
|
],
|
|
40
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
|
41
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
42
|
+
'react/jsx-fragments': 'error',
|
|
43
|
+
'react/jsx-handler-names': 'error',
|
|
44
|
+
'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
|
|
45
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
46
|
+
'react/jsx-no-leaked-render': 'error',
|
|
47
|
+
'react/jsx-no-useless-fragment': 'error',
|
|
48
|
+
'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
|
|
49
|
+
'react/jsx-props-no-multi-spaces': 'error',
|
|
50
|
+
'react/jsx-tag-spacing': 'error',
|
|
51
|
+
'react/no-multi-comp': 'error',
|
|
52
|
+
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
53
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
56
|
]
|
|
@@ -2,8 +2,7 @@ import tseslint from 'typescript-eslint'
|
|
|
2
2
|
|
|
3
3
|
import common from './eslint.config.common.js'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export default tseslint.config(...tseslint.configs.recommended, ...common, {
|
|
5
|
+
export default tseslint.config(...tseslint.configs.recommended, ...tseslint.configs.stylistic, ...common, {
|
|
7
6
|
languageOptions: {
|
|
8
7
|
parserOptions: {
|
|
9
8
|
project: ['tsconfig.json'],
|
|
@@ -11,27 +10,12 @@ export default tseslint.config(...tseslint.configs.recommended, ...common, {
|
|
|
11
10
|
},
|
|
12
11
|
settings: {
|
|
13
12
|
'import/resolver': {
|
|
14
|
-
typescript: {},
|
|
13
|
+
typescript: {},
|
|
15
14
|
},
|
|
16
15
|
},
|
|
17
16
|
rules: {
|
|
18
|
-
'@typescript-eslint/no-
|
|
19
|
-
'@typescript-eslint/
|
|
20
|
-
'@typescript-eslint/no-shadow': [
|
|
21
|
-
'error',
|
|
22
|
-
{
|
|
23
|
-
ignoreTypeValueShadow: true,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
'@typescript-eslint/no-var-requires': ['off'],
|
|
27
|
-
'@typescript-eslint/no-empty-function': ['off'],
|
|
28
|
-
'@typescript-eslint/no-use-before-define': ['error'],
|
|
29
|
-
'@typescript-eslint/no-unused-vars': [
|
|
30
|
-
'error',
|
|
31
|
-
{
|
|
32
|
-
ignoreRestSiblings: true,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
17
|
+
'@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
|
|
18
|
+
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
35
19
|
'@typescript-eslint/ban-ts-comment': [
|
|
36
20
|
'error',
|
|
37
21
|
{
|
|
@@ -40,11 +24,6 @@ export default tseslint.config(...tseslint.configs.recommended, ...common, {
|
|
|
40
24
|
},
|
|
41
25
|
],
|
|
42
26
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
43
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
44
|
-
'error',
|
|
45
|
-
{
|
|
46
|
-
fixStyle: 'inline-type-imports',
|
|
47
|
-
},
|
|
48
|
-
],
|
|
27
|
+
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
|
|
49
28
|
},
|
|
50
29
|
})
|