Skip to content

Commit 0a2a3bf

Browse files
committed
Upgrade ESLint to v9
1 parent 550dfd2 commit 0a2a3bf

File tree

5 files changed

+914
-1192
lines changed

5 files changed

+914
-1192
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import vitest from '@vitest/eslint-plugin';
4+
import eslintConfigPrettier from 'eslint-config-prettier';
5+
import globals from 'globals';
6+
import tseslint from 'typescript-eslint';
7+
8+
// This is just an example default config for ESLint.
9+
// You should change it to your needs following the documentation.
10+
export default tseslint.config(
11+
{
12+
ignores: ['**/build/**', '**/tmp/**', '**/coverage/**'],
13+
},
14+
eslint.configs.recommended,
15+
eslintConfigPrettier,
16+
{
17+
extends: [...tseslint.configs.recommended],
18+
19+
files: ['**/*.ts', '**/*.mts'],
20+
21+
plugins: {
22+
'@typescript-eslint': tseslint.plugin,
23+
},
24+
25+
rules: {
26+
'@typescript-eslint/explicit-function-return-type': 'warn',
27+
},
28+
29+
languageOptions: {
30+
parser: tseslint.parser,
31+
ecmaVersion: 2020,
32+
sourceType: 'module',
33+
34+
globals: {
35+
...globals.node,
36+
},
37+
38+
parserOptions: {
39+
project: './tsconfig.json',
40+
},
41+
},
42+
},
43+
{
44+
files: ['__tests__/**'],
45+
46+
plugins: {
47+
vitest,
48+
},
49+
50+
rules: {
51+
...vitest.configs.recommended.rules,
52+
},
53+
54+
settings: {
55+
vitest: {
56+
typecheck: true,
57+
},
58+
},
59+
60+
languageOptions: {
61+
globals: {
62+
...vitest.environments.env.globals,
63+
},
64+
},
65+
},
66+
);

0 commit comments

Comments
 (0)