Skip to content

Commit 0b016fb

Browse files
committed
Upgrade eslint
ESlint 9 uses a new flat config. The airbnb config is no longer used. Switched to modern `typescript-eslint` * Remove jest
1 parent bdfe426 commit 0b016fb

File tree

7 files changed

+123
-2819
lines changed

7 files changed

+123
-2819
lines changed

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from '@eslint/js';
2+
import typescriptEslint from 'typescript-eslint';
3+
4+
export default [
5+
{
6+
ignores: [
7+
'vendor/**',
8+
'node_modules/**',
9+
'var/**',
10+
'public/build/**',
11+
'.yarn-cache/**',
12+
'build/**',
13+
'dist/**',
14+
],
15+
},
16+
js.configs.recommended,
17+
...typescriptEslint.configs.recommendedTypeChecked,
18+
{
19+
files: ['**/*.ts', '**/*.tsx'],
20+
languageOptions: {
21+
parserOptions: {
22+
project: './tsconfig.json',
23+
tsconfigRootDir: import.meta.dirname,
24+
},
25+
},
26+
rules: {
27+
// Customize rules as needed
28+
'@typescript-eslint/no-explicit-any': 'warn',
29+
'@typescript-eslint/no-unused-vars': 'warn',
30+
},
31+
},
32+
{
33+
// Disable type-checking rules for JS files
34+
files: ['**/*.js', '**/*.jsx'],
35+
...typescriptEslint.configs.disableTypeChecked,
36+
},
37+
];
38+

eslint.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,27 @@
33
"devDependencies": {
44
"@babel/core": "^7.26.9",
55
"@babel/preset-env": "^7.26.9",
6+
"@eslint/eslintrc": "^3.3.1",
7+
"@eslint/js": "^9.39.1",
68
"@popperjs/core": "^2.11.8",
79
"@symfony/webpack-encore": "^5.3.1",
810
"@types/bootstrap": "^5.0.0",
9-
"@types/jest": "^27",
1011
"@types/jquery": "^3.5.32",
11-
"@types/node": "^10",
12+
"@types/node": "^20.0.0",
1213
"@typescript-eslint/eslint-plugin": "^8.47.0",
1314
"@typescript-eslint/parser": "^8.47.0",
1415
"css-loader": "^7.1.2",
1516
"eslint": "^9.39.1",
16-
"eslint-config-airbnb-base": "^15.0.0",
17-
"eslint-config-airbnb-typescript": "^18.0.0",
18-
"eslint-plugin-import": "^2.29.0",
1917
"eslint-webpack-plugin": "^5.0.2",
20-
"jest": "^27",
2118
"less": "^4.4.2",
2219
"less-loader": "^12.3.0",
2320
"loader-utils": "^3.3",
2421
"postcss": ">=8.4.31",
2522
"sass": "^1.94.1",
2623
"sass-loader": "^16.0.6",
27-
"ts-jest": "^27",
2824
"ts-loader": "^9",
2925
"typescript": "^5.9.3",
26+
"typescript-eslint": "^8.47.0",
3027
"webpack": "^5.103.0",
3128
"webpack-cli": "^6.0.1",
3229
"webpack-import-glob-loader": "^1.6.3"

public/typescript/app.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@
1616
import jQuery from 'jquery';
1717
import 'bootstrap';
1818

19-
(window as any).jQuery = jQuery;
19+
declare global {
20+
interface Window {
21+
jQuery: typeof jQuery;
22+
}
23+
}
24+
25+
window.jQuery = jQuery;

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
4040

4141
"types": [
42-
"@types/jest",
4342
"node"
4443
],
4544

0 commit comments

Comments
 (0)