eslint-config-entva-typescript 2.16.0 → 2.18.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.
- package/index.js +60 -86
- package/package.json +7 -6
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ignoreRule, mainRule as baseMainRule, testRule as baseTestRule } from 'eslint-config-entva-base';
|
|
2
|
+
import { mainRule as reactMainRule } from 'eslint-config-entva';
|
|
3
|
+
import { mainRule as tsMainRule, testRule as tsTestRule } from 'eslint-config-entva-typescript-base';
|
|
3
4
|
import react from 'eslint-plugin-react';
|
|
4
5
|
import jsxA11Y from 'eslint-plugin-jsx-a11y';
|
|
5
6
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
@@ -9,104 +10,77 @@ import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
|
9
10
|
import tsParser from '@typescript-eslint/parser';
|
|
10
11
|
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export const mainRule = {
|
|
14
|
+
files: ['**/*.{ts,tsx}'],
|
|
15
|
+
plugins: {
|
|
16
|
+
react,
|
|
17
|
+
'jsx-a11y': jsxA11Y,
|
|
18
|
+
'react-hooks': reactHooks,
|
|
19
|
+
import: importPlugin,
|
|
20
|
+
'@typescript-eslint': typescriptEslint,
|
|
21
|
+
'@stylistic/ts': stylisticTs,
|
|
22
|
+
},
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
plugins: {
|
|
24
|
-
react,
|
|
25
|
-
'jsx-a11y': jsxA11Y,
|
|
26
|
-
'react-hooks': reactHooks,
|
|
27
|
-
import: importPlugin,
|
|
28
|
-
'@typescript-eslint': typescriptEslint,
|
|
29
|
-
'@stylistic/ts': stylisticTs,
|
|
24
|
+
languageOptions: {
|
|
25
|
+
globals: {
|
|
26
|
+
...globals.browser,
|
|
27
|
+
...globals.node,
|
|
30
28
|
},
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...globals.node,
|
|
36
|
-
},
|
|
30
|
+
parser: tsParser,
|
|
31
|
+
ecmaVersion: 'latest',
|
|
32
|
+
sourceType: 'module',
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
parserOptions: {
|
|
35
|
+
parser: '@typescript-eslint/parser',
|
|
36
|
+
project: './tsconfig.json',
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ecmaFeatures: {
|
|
47
|
-
generators: false,
|
|
48
|
-
objectLiteralDuplicateProperties: false,
|
|
49
|
-
jsx: true,
|
|
50
|
-
},
|
|
38
|
+
ecmaFeatures: {
|
|
39
|
+
generators: false,
|
|
40
|
+
objectLiteralDuplicateProperties: false,
|
|
41
|
+
jsx: true,
|
|
51
42
|
},
|
|
52
43
|
},
|
|
44
|
+
},
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
settings: {
|
|
47
|
+
'import/parsers': {
|
|
48
|
+
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
|
|
49
|
+
},
|
|
58
50
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
51
|
+
'import/resolver': {
|
|
52
|
+
node: {
|
|
53
|
+
extensions: ['.js', '.mjs', '.cjs', '.jsx', '.ts', '.tsx', '.d.ts', '.json'],
|
|
63
54
|
},
|
|
55
|
+
},
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
'import/extensions': ['.js', '.mjs', '.cjs', '.jsx', '.ts', '.tsx', '.d.ts', '.json'],
|
|
58
|
+
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
59
|
+
'import/core-modules': [],
|
|
60
|
+
'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
|
|
62
|
+
react: {
|
|
63
|
+
pragma: 'React',
|
|
64
|
+
version: 'detect',
|
|
76
65
|
},
|
|
77
66
|
|
|
78
|
-
|
|
79
|
-
...baseRules,
|
|
80
|
-
'import/first': ['error'],
|
|
81
|
-
'no-unused-vars': ['off'],
|
|
82
|
-
'@typescript-eslint/no-unused-vars': ['error', {
|
|
83
|
-
vars: 'all',
|
|
84
|
-
args: 'after-used',
|
|
85
|
-
ignoreRestSiblings: true,
|
|
86
|
-
caughtErrors: 'none',
|
|
87
|
-
}],
|
|
88
|
-
'react/jsx-filename-extension': ['error', {
|
|
89
|
-
extensions: ['.jsx', '.tsx'],
|
|
90
|
-
}],
|
|
91
|
-
},
|
|
67
|
+
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
|
|
92
68
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
'
|
|
98
|
-
|
|
99
|
-
'**/__tests__/**',
|
|
100
|
-
],
|
|
101
|
-
languageOptions: {
|
|
102
|
-
globals: {
|
|
103
|
-
...globals.jest,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
rules: {
|
|
107
|
-
'import/first': ['off'],
|
|
108
|
-
'no-unused-vars': ['off'],
|
|
109
|
-
'@typescript-eslint/no-unused-vars': ['off'],
|
|
110
|
-
},
|
|
69
|
+
|
|
70
|
+
rules: {
|
|
71
|
+
...reactMainRule.rules,
|
|
72
|
+
'react/jsx-filename-extension': ['error', {
|
|
73
|
+
extensions: ['.jsx', '.tsx'],
|
|
74
|
+
}],
|
|
111
75
|
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default [
|
|
79
|
+
ignoreRule,
|
|
80
|
+
baseMainRule,
|
|
81
|
+
tsMainRule,
|
|
82
|
+
reactMainRule,
|
|
83
|
+
mainRule,
|
|
84
|
+
baseTestRule,
|
|
85
|
+
tsTestRule,
|
|
112
86
|
];
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/entva/styleguide"
|
|
10
10
|
},
|
|
11
11
|
"bugs": "https://github.com/entva/styleguide/issues",
|
|
12
|
-
"version": "2.
|
|
12
|
+
"version": "2.18.0",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"linter",
|
|
15
15
|
"config",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prepublishOnly": "npm test"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^22.10.
|
|
28
|
+
"@types/node": "^22.10.3",
|
|
29
29
|
"@types/react": "^19.0.2",
|
|
30
30
|
"@types/react-dom": "^19.0.2",
|
|
31
31
|
"eslint": "^9.17.0",
|
|
@@ -34,13 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@stylistic/eslint-plugin-ts": "^2.12.1",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
38
|
-
"@typescript-eslint/parser": "^8.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.19.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.19.0",
|
|
39
39
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
40
40
|
"eslint-plugin-react": "^7.37.2",
|
|
41
41
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
42
|
-
"eslint-config-entva": "^2.
|
|
43
|
-
"eslint-config-entva-
|
|
42
|
+
"eslint-config-entva": "^2.18.1",
|
|
43
|
+
"eslint-config-entva-base": "^2.18.0",
|
|
44
|
+
"eslint-config-entva-typescript-base": "^2.18.1",
|
|
44
45
|
"eslint-plugin-import": "^2.31.0",
|
|
45
46
|
"globals": "^15.14.0"
|
|
46
47
|
},
|