Skip to content

Commit 3d0c12d

Browse files
authored
Merge pull request #305 from americano212/update-eslint
update eslint to v9
2 parents 43813c8 + aed37f8 commit 3d0c12d

File tree

7 files changed

+2743
-2815
lines changed

7 files changed

+2743
-2815
lines changed

.eslintrc.json

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

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"singleQuote": true,
33
"trailingComma": "all",
44
"printWidth": 100,
5-
"semi": false
5+
"semi": true,
6+
"endOfLine": "lf"
67
}

eslint.config.mjs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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': 'off',
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': ['error'],
62+
},
63+
},
64+
];

0 commit comments

Comments
 (0)