Skip to content

Commit 3a49d09

Browse files
committed
fixes
1 parent 3419cea commit 3a49d09

File tree

20 files changed

+305
-73
lines changed

20 files changed

+305
-73
lines changed

javascript/packages/eslint-base/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export default [
182182
'**/protractor.conf.*.js',
183183
'**/karma.conf.js',
184184
'**/.eslintrc.js',
185+
'**/.eslint.config.js',
185186
],
186187

187188
optionalDependencies: false,

javascript/packages/eslint-base/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascript/packages/eslint-base/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/entva/styleguide"
1010
},
1111
"bugs": "https://github.com/entva/styleguide/issues",
12-
"version": "2.4.0",
12+
"version": "2.5.0",
1313
"keywords": [
1414
"linter",
1515
"config",

javascript/packages/eslint-react/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascript/packages/eslint-react/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/entva/styleguide"
1010
},
1111
"bugs": "https://github.com/entva/styleguide/issues",
12-
"version": "2.4.0",
12+
"version": "2.5.0",
1313
"keywords": [
1414
"linter",
1515
"config",
@@ -29,7 +29,7 @@
2929
"react": "^19.0.0"
3030
},
3131
"dependencies": {
32-
"eslint-config-entva-base": "^2.4.0",
32+
"eslint-config-entva-base": "^2.5.0",
3333
"eslint-plugin-import": "^2.31.0",
3434
"eslint-plugin-jsx-a11y": "^6.10.2",
3535
"eslint-plugin-react": "^7.37.2",

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"preinstall": "scripts/for-each-package npm install",
1313
"test": "scripts/for-each-package npm run test",
14+
"public": "scripts/for-each-package npm public --access public",
1415
"check": "npm run test"
1516
}
1617
}

scripts/for-each-package

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
PACKAGES=`find . -iname packages -not -path "*/node_modules/*" -exec find {} -maxdepth 1 -mindepth 1 \;`
2+
PACKAGES=`find . -iname packages -not -path "*/node_modules/*" -exec find {} -maxdepth 1 -mindepth 1 \;`
33
EXIT_STATUS=0
44

55
for PACKAGE in $PACKAGES

typescript/packages/eslint-typescript-base/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript/packages/eslint-typescript-base/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/entva/styleguide"
1010
},
1111
"bugs": "https://github.com/entva/styleguide/issues",
12-
"version": "2.4.0",
12+
"version": "2.5.0",
1313
"keywords": [
1414
"linter",
1515
"config",
@@ -31,7 +31,7 @@
3131
"@stylistic/eslint-plugin-ts": "^2.12.1",
3232
"@typescript-eslint/eslint-plugin": "^8.18.0",
3333
"@typescript-eslint/parser": "^8.18.0",
34-
"eslint-config-entva-base": "^2.4.0",
34+
"eslint-config-entva-base": "^2.5.0",
3535
"eslint-plugin-import": "^2.31.0",
3636
"globals": "^15.13.0"
3737
},

typescript/packages/eslint-typescript-react/index.js

+39-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
import baseConfig from 'eslint-config-entva';
22
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';
46
import importPlugin from 'eslint-plugin-import';
57
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+
}, {});
623

724
export default [
825
...baseConfig,
@@ -20,8 +37,19 @@ export default [
2037
},
2138
{
2239
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
40+
ignores: [
41+
'**/node_modules/',
42+
'**/public/',
43+
'**/coverage/',
44+
'**/.*',
45+
],
2346
plugins: {
47+
react,
48+
'jsx-a11y': jsxA11Y,
49+
'react-hooks': reactHooks,
2450
import: importPlugin,
51+
'@typescript-eslint': typescriptEslint,
52+
'@stylistic/ts': stylisticTs,
2553
},
2654

2755
languageOptions: {
@@ -47,16 +75,16 @@ export default [
4775
},
4876

4977
settings: {
78+
'import/parsers': {
79+
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
80+
},
81+
5082
'import/resolver': {
5183
node: {
5284
extensions: ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
5385
},
5486
},
5587

56-
'import/parsers': {
57-
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
58-
},
59-
6088
'import/extensions': ['.mjs', '.js', '.json', '.jsx', '.ts', '.tsx', '.d.ts'],
6189
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
6290
'import/core-modules': [],
@@ -70,6 +98,11 @@ export default [
7098
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
7199
},
72100

73-
rules: {},
101+
rules: {
102+
...baseRules,
103+
'react/jsx-filename-extension': ['error', {
104+
extensions: ['.jsx', '.tsx'],
105+
}],
106+
},
74107
},
75108
];

0 commit comments

Comments
 (0)