@st1ggy/linter-config 1.0.48 → 1.0.50
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 +37 -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,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
|
|
2
|
+
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
|
|
2
3
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
3
4
|
|
|
4
5
|
import typescript from './eslint.config.typescript.js'
|
|
5
6
|
|
|
6
7
|
export default [
|
|
7
8
|
...typescript,
|
|
9
|
+
reactRecommended,
|
|
10
|
+
reactJsxRuntime,
|
|
11
|
+
// reactHooksPlugin.configs.recommended,
|
|
8
12
|
{
|
|
9
|
-
plugins: {
|
|
10
|
-
react: reactPlugin,
|
|
11
|
-
'react-hooks': reactHooksPlugin,
|
|
12
|
-
},
|
|
13
|
+
plugins: { 'react-hooks': reactHooksPlugin },
|
|
13
14
|
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',
|
|
15
|
+
'react/boolean-prop-naming': 'error',
|
|
16
|
+
'react/button-has-type': 'error',
|
|
17
|
+
'react/checked-requires-onchange-or-readonly': 'error',
|
|
18
|
+
'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
|
|
19
|
+
'react/destructuring-assignment': 'error',
|
|
41
20
|
'react/function-component-definition': [
|
|
42
21
|
'error',
|
|
43
22
|
{
|
|
@@ -45,13 +24,35 @@ export default [
|
|
|
45
24
|
unnamedComponents: 'arrow-function',
|
|
46
25
|
},
|
|
47
26
|
],
|
|
48
|
-
'react/
|
|
49
|
-
|
|
27
|
+
'react/hook-use-state': 'error',
|
|
28
|
+
'react/jsx-boolean-value': 'error',
|
|
29
|
+
'react/jsx-child-element-spacing': 'error',
|
|
30
|
+
'react/jsx-closing-bracket-location': 'error',
|
|
31
|
+
'react/jsx-closing-tag-location': 'error',
|
|
32
|
+
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
|
33
|
+
'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
|
|
34
|
+
'react/jsx-curly-spacing': [
|
|
35
|
+
'error',
|
|
50
36
|
{
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
when: 'never',
|
|
38
|
+
attributes: { allowMultiline: false },
|
|
39
|
+
children: false,
|
|
53
40
|
},
|
|
54
41
|
],
|
|
42
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
|
43
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
44
|
+
'react/jsx-fragments': 'error',
|
|
45
|
+
'react/jsx-handler-names': 'error',
|
|
46
|
+
'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
|
|
47
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
48
|
+
'react/jsx-no-leaked-render': 'error',
|
|
49
|
+
'react/jsx-no-useless-fragment': 'error',
|
|
50
|
+
'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
|
|
51
|
+
'react/jsx-props-no-multi-spaces': 'error',
|
|
52
|
+
'react/jsx-tag-spacing': 'error',
|
|
53
|
+
'react/no-multi-comp': 'error',
|
|
54
|
+
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
55
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
55
56
|
},
|
|
56
57
|
},
|
|
57
58
|
]
|
|
@@ -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
|
})
|