Skip to content

Commit 4481516

Browse files
authored
⬆️ Upgrade to ESLint 9 (#25)
* ⬆️ Upgrade to ESLint 9 * 🔧 Lint eslint.config.js
1 parent a4abc9a commit 4481516

File tree

6 files changed

+1467
-1277
lines changed

6 files changed

+1467
-1277
lines changed

.eslintignore

-5
This file was deleted.

.eslintrc.yaml

-43
This file was deleted.

eslint.config.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import eslint from "@eslint/js"
2+
import prettier from "eslint-config-prettier"
3+
import tseslint from "typescript-eslint"
4+
5+
export default tseslint.config(
6+
{
7+
languageOptions: {
8+
parserOptions: { project: "./tsconfig.eslint.json" },
9+
},
10+
},
11+
12+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
13+
eslint.configs.recommended,
14+
...tseslint.configs.strictTypeChecked,
15+
...tseslint.configs.stylisticTypeChecked,
16+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
17+
prettier,
18+
19+
{
20+
rules: {
21+
"@typescript-eslint/class-methods-use-this": [
22+
"error",
23+
{
24+
ignoreClassesThatImplementAnInterface: true,
25+
ignoreOverrideMethods: true,
26+
},
27+
],
28+
"@typescript-eslint/consistent-type-exports": "error",
29+
"@typescript-eslint/consistent-type-imports": [
30+
"error",
31+
{ fixStyle: "separate-type-imports" },
32+
],
33+
"@typescript-eslint/default-param-last": "error",
34+
"@typescript-eslint/explicit-member-accessibility": [
35+
"error",
36+
{ accessibility: "no-public" },
37+
],
38+
"@typescript-eslint/method-signature-style": "error",
39+
"@typescript-eslint/no-import-type-side-effects": "error",
40+
"@typescript-eslint/no-unnecessary-qualifier": "error",
41+
"@typescript-eslint/no-useless-empty-export": "error",
42+
"@typescript-eslint/prefer-nullish-coalescing": [
43+
"error",
44+
{ ignorePrimitives: true },
45+
],
46+
"@typescript-eslint/prefer-readonly": "error",
47+
"@typescript-eslint/prefer-regexp-exec": "error",
48+
"@typescript-eslint/promise-function-async": [
49+
"error",
50+
{ checkArrowFunctions: false },
51+
],
52+
"@typescript-eslint/require-array-sort-compare": "error",
53+
"@typescript-eslint/return-await": "error",
54+
"@typescript-eslint/sort-type-constituents": "error",
55+
"@typescript-eslint/switch-exhaustiveness-check": "error",
56+
"func-style": ["error", "declaration"],
57+
},
58+
},
59+
{
60+
ignores: [
61+
".pnpm-store/",
62+
"dist/",
63+
"docs/",
64+
"node_modules/",
65+
"package-lock.json",
66+
"pnpm-lock.yaml",
67+
],
68+
},
69+
)

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
"test:watch": "vitest --watch"
2525
},
2626
"devDependencies": {
27-
"@typescript-eslint/eslint-plugin": "^7.4.0",
28-
"@typescript-eslint/parser": "^7.4.0",
29-
"eslint": "^8.57.0",
27+
"@eslint/js": "^9.4.0",
28+
"eslint": "^9.4.0",
3029
"eslint-config-prettier": "^9.1.0",
3130
"openai": "^4.29.2",
3231
"prettier": "^3.1.0",
3332
"typedoc": "^0.25.12",
3433
"typescript": "^5.4.3",
34+
"typescript-eslint": "^7.12.0",
3535
"vite": "^5.2.6",
3636
"vitest": "^1.4.0"
3737
},

0 commit comments

Comments
 (0)