-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
54 lines (48 loc) · 1.45 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import globals from 'globals'
import pluginJs from '@eslint/js'
import tsEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import standard from 'eslint-config-standard'
import jestPlugin from 'eslint-plugin-jest'
import importPlugin from 'eslint-plugin-import'
import nPlugin from 'eslint-plugin-n'
import promisePlugin from 'eslint-plugin-promise'
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: [
'**/*.{js,mjs,cjs,ts}'
],
ignores: [
'node_modules/**',
'lib/**',
'types.d.ts'
],
languageOptions: {
parser: tsParser,
globals: {
...globals.browser,
...globals.node,
...jestPlugin.environments.globals.globals // 添加 Jest 全局变量
}
},
plugins: {
n: nPlugin,
import: importPlugin,
promise: promisePlugin,
jest: jestPlugin,
'@typescript-eslint': tsEslint
},
rules: {
...pluginJs.configs.recommended.rules,
...tsEslint.configs.recommended.rules,
...jestPlugin.configs.recommended.rules,
...standard.rules,
indent: [2, 4],
'no-unused-vars': 1,
'no-console': 1,
'no-debugger': 1,
'standard/no-callback-literal': 0
}
}
]