@innovixx/eslint-config 3.0.0 → 3.0.2
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/config/configs/base/rules/style.mjs +1 -1
- package/config/configs/typescript/index.mjs +10 -2
- package/config/configs/typescript/rules/all.mjs +158 -0
- package/config/index.mjs +21 -21
- package/demo/components/AnotherComponentTest/index.tsx +5 -1
- package/eslint.config.mjs +2 -2
- package/package.json +1 -1
- package/tsconfig.json +18 -0
- package/config/configs/typescript/rules/variables.mjs +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
2
2
|
import tsParser from '@typescript-eslint/parser';
|
|
3
3
|
import typeScriptSettings from './settings/typescript.mjs';
|
|
4
|
-
import
|
|
4
|
+
import allRules from './rules/all.mjs';
|
|
5
5
|
import { deepMerge } from '../../deepMerge.mjs';
|
|
6
6
|
|
|
7
7
|
/** @type {import('eslint').Linter.Config} */
|
|
@@ -11,7 +11,7 @@ export const index = deepMerge(
|
|
|
11
11
|
settings: typeScriptSettings.settings,
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
rules:
|
|
14
|
+
rules: allRules.rules,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
plugins: {
|
|
@@ -21,6 +21,14 @@ export const index = deepMerge(
|
|
|
21
21
|
{
|
|
22
22
|
languageOptions: {
|
|
23
23
|
parser: tsParser,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaVersion: 2020,
|
|
26
|
+
project: './tsconfig.json',
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
ecmaFeatures: {
|
|
29
|
+
jsx: true,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
24
32
|
},
|
|
25
33
|
},
|
|
26
34
|
);
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/** @type {import('eslint').Linter.Config} */
|
|
2
|
+
|
|
3
|
+
const variableRules = {
|
|
4
|
+
rules: {
|
|
5
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
6
|
+
'@typescript-eslint/array-type': 'error',
|
|
7
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
8
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
9
|
+
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
10
|
+
'@typescript-eslint/class-literal-property-style': 'error',
|
|
11
|
+
'class-methods-use-this': 'off',
|
|
12
|
+
'@typescript-eslint/class-methods-use-this': 'error',
|
|
13
|
+
'@typescript-eslint/consistent-generic-constructors': 'error',
|
|
14
|
+
'@typescript-eslint/consistent-indexed-object-style': 'error',
|
|
15
|
+
'consistent-return': 'off',
|
|
16
|
+
'@typescript-eslint/consistent-return': 'error',
|
|
17
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
18
|
+
'@typescript-eslint/consistent-type-definitions': 'error',
|
|
19
|
+
'@typescript-eslint/consistent-type-exports': 'error',
|
|
20
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
21
|
+
'default-param-last': 'off',
|
|
22
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
23
|
+
'dot-notation': 'off',
|
|
24
|
+
'@typescript-eslint/dot-notation': 'error',
|
|
25
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
26
|
+
'@typescript-eslint/explicit-member-accessibility': 'error',
|
|
27
|
+
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
28
|
+
'init-declarations': 'off',
|
|
29
|
+
'@typescript-eslint/init-declarations': 'error',
|
|
30
|
+
'max-params': 'off',
|
|
31
|
+
'@typescript-eslint/max-params': 'error',
|
|
32
|
+
'@typescript-eslint/member-ordering': 'error',
|
|
33
|
+
'@typescript-eslint/method-signature-style': 'error',
|
|
34
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
35
|
+
'no-array-constructor': 'off',
|
|
36
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
37
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
38
|
+
'@typescript-eslint/no-base-to-string': 'error',
|
|
39
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
40
|
+
'@typescript-eslint/no-confusing-void-expression': 'error',
|
|
41
|
+
'@typescript-eslint/no-deprecated': 'error',
|
|
42
|
+
'no-dupe-class-members': 'off',
|
|
43
|
+
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
44
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
45
|
+
'@typescript-eslint/no-duplicate-type-constituents': 'error',
|
|
46
|
+
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
47
|
+
'no-empty-function': 'off',
|
|
48
|
+
'@typescript-eslint/no-empty-function': 'error',
|
|
49
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
50
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
51
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
52
|
+
'@typescript-eslint/no-extraneous-class': 'error',
|
|
53
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
54
|
+
'@typescript-eslint/no-for-in-array': 'error',
|
|
55
|
+
'no-implied-eval': 'off',
|
|
56
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
57
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
58
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
59
|
+
'no-invalid-this': 'off',
|
|
60
|
+
'@typescript-eslint/no-invalid-this': 'error',
|
|
61
|
+
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
62
|
+
'no-loop-func': 'off',
|
|
63
|
+
'@typescript-eslint/no-loop-func': 'error',
|
|
64
|
+
'no-magic-numbers': 'off',
|
|
65
|
+
'@typescript-eslint/no-magic-numbers': 'off',
|
|
66
|
+
'@typescript-eslint/no-meaningless-void-operator': 'error',
|
|
67
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
68
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
69
|
+
'@typescript-eslint/no-misused-spread': 'error',
|
|
70
|
+
'@typescript-eslint/no-mixed-enums': 'error',
|
|
71
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
72
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
73
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
74
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
75
|
+
'no-redeclare': 'off',
|
|
76
|
+
'@typescript-eslint/no-redeclare': 'error',
|
|
77
|
+
'@typescript-eslint/no-redundant-type-constituents': 'error',
|
|
78
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
79
|
+
'no-restricted-imports': 'off',
|
|
80
|
+
'@typescript-eslint/no-restricted-imports': 'error',
|
|
81
|
+
'@typescript-eslint/no-restricted-types': 'error',
|
|
82
|
+
'no-shadow': 'off',
|
|
83
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
84
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
85
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
86
|
+
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
87
|
+
'@typescript-eslint/no-unnecessary-parameter-property-assignment':
|
|
88
|
+
'error',
|
|
89
|
+
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
90
|
+
'@typescript-eslint/no-unnecessary-template-expression': 'error',
|
|
91
|
+
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
92
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
93
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
94
|
+
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
|
|
95
|
+
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
96
|
+
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
97
|
+
'@typescript-eslint/no-unsafe-call': 'error',
|
|
98
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
99
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
100
|
+
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
101
|
+
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
102
|
+
'@typescript-eslint/no-unsafe-return': 'error',
|
|
103
|
+
'@typescript-eslint/no-unsafe-type-assertion': 'error',
|
|
104
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
105
|
+
'no-unused-expressions': 'off',
|
|
106
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
107
|
+
'no-unused-vars': 'off',
|
|
108
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
109
|
+
'no-use-before-define': 'off',
|
|
110
|
+
'@typescript-eslint/no-use-before-define': 'error',
|
|
111
|
+
'no-useless-constructor': 'off',
|
|
112
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
113
|
+
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
114
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
115
|
+
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
|
|
116
|
+
'no-throw-literal': 'off',
|
|
117
|
+
'@typescript-eslint/only-throw-error': 'error',
|
|
118
|
+
'@typescript-eslint/parameter-properties': 'error',
|
|
119
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
120
|
+
'prefer-destructuring': 'off',
|
|
121
|
+
'@typescript-eslint/prefer-destructuring': 'error',
|
|
122
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
123
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
124
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
125
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
126
|
+
'@typescript-eslint/prefer-includes': 'error',
|
|
127
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
128
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
129
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
130
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
131
|
+
'prefer-promise-reject-errors': 'off',
|
|
132
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'error',
|
|
133
|
+
'@typescript-eslint/prefer-readonly': 'error',
|
|
134
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
135
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
|
|
136
|
+
'@typescript-eslint/prefer-regexp-exec': 'error',
|
|
137
|
+
'@typescript-eslint/prefer-return-this-type': 'error',
|
|
138
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
139
|
+
'@typescript-eslint/promise-function-async': 'error',
|
|
140
|
+
'@typescript-eslint/related-getter-setter-pairs': 'error',
|
|
141
|
+
'@typescript-eslint/require-array-sort-compare': 'error',
|
|
142
|
+
'require-await': 'off',
|
|
143
|
+
'@typescript-eslint/require-await': 'error',
|
|
144
|
+
'@typescript-eslint/restrict-plus-operands': 'error',
|
|
145
|
+
'@typescript-eslint/restrict-template-expressions': 'error',
|
|
146
|
+
'no-return-await': 'off',
|
|
147
|
+
'@typescript-eslint/return-await': 'error',
|
|
148
|
+
'@typescript-eslint/strict-boolean-expressions': 'error',
|
|
149
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
150
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
151
|
+
'@typescript-eslint/typedef': 'error',
|
|
152
|
+
'@typescript-eslint/unbound-method': 'error',
|
|
153
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
154
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export default variableRules;
|
package/config/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import tseslint from 'typescript-eslint'
|
|
2
|
-
import { configs as regexpPluginConfigs } from 'eslint-plugin-regexp'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { deepMerge } from './deepMerge.mjs'
|
|
1
|
+
import tseslint from 'typescript-eslint';
|
|
2
|
+
import { configs as regexpPluginConfigs } from 'eslint-plugin-regexp';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import typescriptParser from '@typescript-eslint/parser';
|
|
5
|
+
import reactExtends from './configs/react/index.mjs';
|
|
6
|
+
import jestExtends from './configs/jest/index.mjs';
|
|
7
|
+
import { deepMerge } from './deepMerge.mjs';
|
|
8
8
|
|
|
9
9
|
const baseRules = {
|
|
10
10
|
'class-methods-use-this': 'off',
|
|
@@ -19,14 +19,14 @@ const baseRules = {
|
|
|
19
19
|
'no-use-before-define': 'off',
|
|
20
20
|
'object-shorthand': 'warn',
|
|
21
21
|
'no-useless-escape': 'warn',
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
24
|
const reactA11yRules = {
|
|
25
25
|
'jsx-a11y/anchor-is-valid': 'warn',
|
|
26
26
|
'jsx-a11y/control-has-associated-label': 'warn',
|
|
27
27
|
'jsx-a11y/no-static-element-interactions': 'warn',
|
|
28
28
|
'jsx-a11y/label-has-associated-control': 'warn',
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
const typeScriptRules = {
|
|
32
32
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
@@ -73,14 +73,14 @@ const typeScriptRules = {
|
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
75
|
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
|
|
78
78
|
/** @typedef {import('eslint').Linter.Config} Config */
|
|
79
79
|
|
|
80
80
|
/** @type {FlatConfig} */
|
|
81
81
|
const baseExtends = deepMerge(
|
|
82
82
|
regexpPluginConfigs['flat/recommended'],
|
|
83
|
-
)
|
|
83
|
+
);
|
|
84
84
|
|
|
85
85
|
/** @type {Config[]} */
|
|
86
86
|
export const rootEslintConfig = [
|
|
@@ -90,12 +90,12 @@ export const rootEslintConfig = [
|
|
|
90
90
|
parserOptions: {
|
|
91
91
|
ecmaFeatures: {
|
|
92
92
|
jsx: true,
|
|
93
|
-
}
|
|
93
|
+
},
|
|
94
94
|
},
|
|
95
95
|
ecmaVersion: 'latest',
|
|
96
96
|
sourceType: 'module',
|
|
97
97
|
globals: {
|
|
98
|
-
...globals.node
|
|
98
|
+
...globals.node,
|
|
99
99
|
},
|
|
100
100
|
parser: typescriptParser,
|
|
101
101
|
},
|
|
@@ -112,8 +112,8 @@ export const rootEslintConfig = [
|
|
|
112
112
|
rules: {
|
|
113
113
|
...baseRules,
|
|
114
114
|
...typeScriptRules,
|
|
115
|
-
}
|
|
116
|
-
}
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
117
|
),
|
|
118
118
|
files: ['**/*.ts'],
|
|
119
119
|
},
|
|
@@ -130,8 +130,8 @@ export const rootEslintConfig = [
|
|
|
130
130
|
...baseRules,
|
|
131
131
|
...typeScriptRules,
|
|
132
132
|
...reactA11yRules,
|
|
133
|
-
}
|
|
134
|
-
}
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
135
|
),
|
|
136
136
|
files: ['**/*.tsx'],
|
|
137
137
|
},
|
|
@@ -141,10 +141,10 @@ export const rootEslintConfig = [
|
|
|
141
141
|
rules: {
|
|
142
142
|
...baseRules,
|
|
143
143
|
...typeScriptRules,
|
|
144
|
-
}
|
|
144
|
+
},
|
|
145
145
|
}),
|
|
146
146
|
files: ['**/*.test.ts', '**/*.test.tsx'],
|
|
147
|
-
}
|
|
148
|
-
]
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
149
|
|
|
150
|
-
export default rootEslintConfig
|
|
150
|
+
export default rootEslintConfig;
|
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"inlineSources": true,
|
|
12
|
+
"sourceRoot": "/",
|
|
13
|
+
"jsx": "react",
|
|
14
|
+
},
|
|
15
|
+
"exclude": [
|
|
16
|
+
"node_modules",
|
|
17
|
+
]
|
|
18
|
+
}
|