eslint-config-entva-typescript 2.0.0 → 2.4.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 +50 -6
- package/package.json +15 -6
- package/tsconfig.json +6 -9
package/index.js
CHANGED
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
import baseConfig from 'eslint-config-entva';
|
|
2
2
|
import tsConfig from 'eslint-config-entva-typescript-base';
|
|
3
|
-
import
|
|
3
|
+
import react from 'eslint-plugin-react';
|
|
4
|
+
import jsxA11Y from 'eslint-plugin-jsx-a11y';
|
|
5
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
6
|
import importPlugin from 'eslint-plugin-import';
|
|
5
7
|
import globals from 'globals';
|
|
8
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
9
|
+
import tsParser from '@typescript-eslint/parser';
|
|
10
|
+
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
11
|
+
|
|
12
|
+
// ESLint 9 is shit at merging config rules so we have to do it by hand.
|
|
13
|
+
// Thanks ESLint <3
|
|
14
|
+
const baseRules = [...baseConfig, ...tsConfig].reduce((acc, config) => {
|
|
15
|
+
if (config.rules) {
|
|
16
|
+
Object.keys(config.rules).forEach((rule) => {
|
|
17
|
+
acc[rule] = config.rules[rule];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
6
23
|
|
|
7
24
|
export default [
|
|
8
25
|
...baseConfig,
|
|
9
26
|
...tsConfig,
|
|
27
|
+
{
|
|
28
|
+
files: [
|
|
29
|
+
'**/*.test.tsx',
|
|
30
|
+
'**/*.spec.tsx',
|
|
31
|
+
],
|
|
32
|
+
languageOptions: {
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.jest,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
10
38
|
{
|
|
11
39
|
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
|
|
40
|
+
ignores: [
|
|
41
|
+
'**/node_modules/',
|
|
42
|
+
'**/public/',
|
|
43
|
+
'**/coverage/',
|
|
44
|
+
'**/.*',
|
|
45
|
+
],
|
|
12
46
|
plugins: {
|
|
47
|
+
react,
|
|
48
|
+
'jsx-a11y': jsxA11Y,
|
|
49
|
+
'react-hooks': reactHooks,
|
|
13
50
|
import: importPlugin,
|
|
51
|
+
'@typescript-eslint': typescriptEslint,
|
|
52
|
+
'@stylistic/ts': stylisticTs,
|
|
14
53
|
},
|
|
15
54
|
|
|
16
55
|
languageOptions: {
|
|
@@ -36,16 +75,16 @@ export default [
|
|
|
36
75
|
},
|
|
37
76
|
|
|
38
77
|
settings: {
|
|
78
|
+
'import/parsers': {
|
|
79
|
+
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
|
|
80
|
+
},
|
|
81
|
+
|
|
39
82
|
'import/resolver': {
|
|
40
83
|
node: {
|
|
41
84
|
extensions: ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
|
|
42
85
|
},
|
|
43
86
|
},
|
|
44
87
|
|
|
45
|
-
'import/parsers': {
|
|
46
|
-
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
|
|
47
|
-
},
|
|
48
|
-
|
|
49
88
|
'import/extensions': ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
|
|
50
89
|
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
51
90
|
'import/core-modules': [],
|
|
@@ -59,6 +98,11 @@ export default [
|
|
|
59
98
|
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
|
|
60
99
|
},
|
|
61
100
|
|
|
62
|
-
rules: {
|
|
101
|
+
rules: {
|
|
102
|
+
...baseRules,
|
|
103
|
+
'react/jsx-filename-extension': ['error', {
|
|
104
|
+
extensions: ['.jsx', '.tsx'],
|
|
105
|
+
}],
|
|
106
|
+
},
|
|
63
107
|
},
|
|
64
108
|
];
|
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.4.0",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"linter",
|
|
15
15
|
"config",
|
|
@@ -20,18 +20,27 @@
|
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"reinstall": "rm -rf node_modules package-lock.json && npm install",
|
|
23
|
-
"test": "node ../../../test ./test js
|
|
24
|
-
"rules": "node_modules/.bin/eslint --print-config file.
|
|
23
|
+
"test": "node ../../../test ./test js tsx",
|
|
24
|
+
"rules": "node_modules/.bin/eslint --print-config file.tsx > eslint-ruleset-output.json",
|
|
25
25
|
"prepublishOnly": "npm test"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@types/node": "^22.10.1",
|
|
29
|
+
"@types/react": "^19.0.1",
|
|
30
|
+
"@types/react-dom": "^19.0.2",
|
|
31
|
+
"eslint": "^9.16.0",
|
|
28
32
|
"react": "^19.0.0",
|
|
29
|
-
"
|
|
33
|
+
"typescript": "^5.7.2"
|
|
30
34
|
},
|
|
31
35
|
"dependencies": {
|
|
36
|
+
"@stylistic/eslint-plugin-ts": "^2.12.1",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
32
38
|
"@typescript-eslint/parser": "^8.18.0",
|
|
33
|
-
"eslint-
|
|
34
|
-
"eslint-
|
|
39
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
40
|
+
"eslint-plugin-react": "^7.37.2",
|
|
41
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
42
|
+
"eslint-config-entva": "^2.4.0",
|
|
43
|
+
"eslint-config-entva-typescript-base": "^2.4.0",
|
|
35
44
|
"eslint-plugin-import": "^2.31.0",
|
|
36
45
|
"globals": "^15.13.0"
|
|
37
46
|
},
|
package/tsconfig.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
"lib": [
|
|
5
|
-
"dom",
|
|
6
|
-
"dom.iterable",
|
|
7
|
-
"esnext"
|
|
8
|
-
],
|
|
3
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
9
4
|
"allowJs": true,
|
|
10
5
|
"skipLibCheck": true,
|
|
11
6
|
"strict": true,
|
|
@@ -13,16 +8,18 @@
|
|
|
13
8
|
"noEmit": true,
|
|
14
9
|
"esModuleInterop": true,
|
|
15
10
|
"module": "esnext",
|
|
16
|
-
"moduleResolution": "
|
|
11
|
+
"moduleResolution": "bundler",
|
|
17
12
|
"resolveJsonModule": true,
|
|
18
13
|
"isolatedModules": true,
|
|
19
14
|
"jsx": "preserve",
|
|
20
|
-
"incremental": true
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"verbatimModuleSyntax": false,
|
|
21
17
|
},
|
|
22
18
|
"include": [
|
|
23
19
|
"**/*.ts",
|
|
24
20
|
"**/*.tsx",
|
|
25
|
-
"**/*.js"
|
|
21
|
+
"**/*.js",
|
|
22
|
+
"**/*.jsx"
|
|
26
23
|
],
|
|
27
24
|
"exclude": [
|
|
28
25
|
"node_modules"
|