Skip to content

Commit c6532ea

Browse files
committed
chore: modernise linting setup
1 parent e5a5aad commit c6532ea

File tree

5 files changed

+600
-882
lines changed

5 files changed

+600
-882
lines changed

.eslintignore

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

.eslintrc.js

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

eslint.config.js

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 globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
import { defineConfig } from 'eslint/config';
5+
6+
export default defineConfig(
7+
js.configs.recommended,
8+
{
9+
languageOptions: {
10+
ecmaVersion: 'latest',
11+
sourceType: 'module',
12+
globals: {
13+
...globals.browser,
14+
...globals.node,
15+
},
16+
},
17+
},
18+
tseslint.configs.eslintRecommended,
19+
...tseslint.configs.recommended,
20+
{
21+
files: ['**/*.ts', '**/*.tsx'],
22+
languageOptions: {
23+
parserOptions: {
24+
projectService: true,
25+
},
26+
},
27+
rules: {
28+
'@typescript-eslint/consistent-type-imports': [
29+
'error',
30+
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
31+
],
32+
'@typescript-eslint/consistent-type-exports': [
33+
'error',
34+
{ fixMixedExportsWithInlineTypeSpecifier: true },
35+
],
36+
},
37+
}
38+
);

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"test": "echo \"Error: no test specified\" && exit 1",
2828
"start": "yarn parcel test/test.html --port 3000 --host 0.0.0.0",
2929
"type-check": "yarn tsc --noEmit",
30-
"lint": "yarn eslint --config ./.eslintrc.js --ext .js,.ts src/",
30+
"lint": "yarn eslint src/",
3131
"postinstall": "yarn husky",
3232
"precommit": "yarn lint-staged"
3333
},
@@ -51,15 +51,16 @@
5151
"jszip": "^3.10.1"
5252
},
5353
"devDependencies": {
54+
"@eslint/js": "^9.39.2",
5455
"@types/gzip-js": "^0.3.5",
55-
"@typescript-eslint/eslint-plugin": "^5.62.0",
56-
"@typescript-eslint/parser": "^5.62.0",
57-
"eslint": "^8.57.1",
56+
"eslint": "^9.39.2",
57+
"globals": "^16.4.0",
5858
"husky": "^9.1.7",
5959
"lint-staged": "^16.2.7",
6060
"parcel": "^2.16.3",
6161
"prettier": "^3.7.4",
62-
"typescript": "^5.9.3"
62+
"typescript": "^5.9.3",
63+
"typescript-eslint": "^8.50.0"
6364
},
6465
"browserslist": [
6566
"last 1 Chrome version"

0 commit comments

Comments
 (0)