eslint-config-entva-typescript 2.1.0 → 2.5.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.
Files changed (3) hide show
  1. package/index.js +39 -6
  2. package/package.json +15 -6
  3. package/tsconfig.json +6 -9
package/index.js CHANGED
@@ -1,8 +1,25 @@
1
1
  import baseConfig from 'eslint-config-entva';
2
2
  import tsConfig from 'eslint-config-entva-typescript-base';
3
- import tsParser from '@typescript-eslint/parser';
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,
@@ -20,8 +37,19 @@ export default [
20
37
  },
21
38
  {
22
39
  files: ['**/*.{js,mjs,cjs,ts,tsx}'],
40
+ ignores: [
41
+ '**/node_modules/',
42
+ '**/public/',
43
+ '**/coverage/',
44
+ '**/.*',
45
+ ],
23
46
  plugins: {
47
+ react,
48
+ 'jsx-a11y': jsxA11Y,
49
+ 'react-hooks': reactHooks,
24
50
  import: importPlugin,
51
+ '@typescript-eslint': typescriptEslint,
52
+ '@stylistic/ts': stylisticTs,
25
53
  },
26
54
 
27
55
  languageOptions: {
@@ -47,16 +75,16 @@ export default [
47
75
  },
48
76
 
49
77
  settings: {
78
+ 'import/parsers': {
79
+ '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
80
+ },
81
+
50
82
  'import/resolver': {
51
83
  node: {
52
84
  extensions: ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
53
85
  },
54
86
  },
55
87
 
56
- 'import/parsers': {
57
- '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
58
- },
59
-
60
88
  'import/extensions': ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
61
89
  'import/external-module-folders': ['node_modules', 'node_modules/@types'],
62
90
  'import/core-modules': [],
@@ -70,6 +98,11 @@ export default [
70
98
  propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
71
99
  },
72
100
 
73
- rules: {},
101
+ rules: {
102
+ ...baseRules,
103
+ 'react/jsx-filename-extension': ['error', {
104
+ extensions: ['.jsx', '.tsx'],
105
+ }],
106
+ },
74
107
  },
75
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.1.0",
12
+ "version": "2.5.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 ts",
24
- "rules": "node_modules/.bin/eslint --print-config file.js > eslint-ruleset-output.json",
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
- "eslint": "^9.16.0"
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-config-entva": "^2.2.0",
34
- "eslint-config-entva-typescript-base": "^2.2.0",
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.5.0",
43
+ "eslint-config-entva-typescript-base": "^2.5.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
- "target": "es5",
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": "node",
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"