Skip to content

Commit a2510c6

Browse files
committed
style: Update eslint to v9
1 parent 43813c8 commit a2510c6

File tree

2 files changed

+70
-35
lines changed

2 files changed

+70
-35
lines changed

.eslintrc.json

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

eslint.config.mjs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin'
2+
import jest from 'eslint-plugin-jest'
3+
import globals from 'globals'
4+
import tsParser from '@typescript-eslint/parser'
5+
import path from 'node:path'
6+
import { fileURLToPath } from 'node:url'
7+
import js from '@eslint/js'
8+
import { FlatCompat } from '@eslint/eslintrc'
9+
10+
const __filename = fileURLToPath(import.meta.url)
11+
const __dirname = path.dirname(__filename)
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
})
17+
18+
export default [
19+
{
20+
ignores: ['./eslint.eslintrc.mjs'],
21+
},
22+
...compat.extends(
23+
'plugin:@typescript-eslint/recommended',
24+
'plugin:prettier/recommended',
25+
'prettier',
26+
),
27+
{
28+
plugins: {
29+
'@typescript-eslint': typescriptEslintEslintPlugin,
30+
jest,
31+
},
32+
33+
languageOptions: {
34+
globals: {
35+
...globals.node,
36+
...globals.jest,
37+
},
38+
39+
parser: tsParser,
40+
ecmaVersion: 5,
41+
sourceType: 'module',
42+
43+
parserOptions: {
44+
project: './tsconfig.json',
45+
tsconfigRootDir: './',
46+
},
47+
},
48+
files: ['src/**/*.ts', 'test/**/*.ts'],
49+
rules: {
50+
'@typescript-eslint/explicit-function-return-type': 'warn',
51+
'@typescript-eslint/explicit-module-boundary-types': 'off',
52+
'@typescript-eslint/no-explicit-any': 'off',
53+
54+
'jest/expect-expect': [
55+
'error',
56+
{
57+
assertFunctionNames: ['expect', 'request.*.expect'],
58+
},
59+
],
60+
61+
'prettier/prettier': [
62+
'error',
63+
{
64+
endOfLine: 'lf',
65+
semi: true,
66+
},
67+
],
68+
},
69+
},
70+
]

0 commit comments

Comments
 (0)