-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
50 lines (43 loc) · 1.17 KB
/
eslint.config.js
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
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
export default [
// 应用 TypeScript ESLint 推荐配置
...tseslint.configs.recommended,
{
ignores: ['node_modules/**', 'build/**', 'release/**', '**/*.json', '**/*.html', '**/*.css'],
},
{
files: ['packages/shared/**/*.{js,ts}'],
ignore: ['config/**/*.{js,ts}'],
},
// 全局配置
{
files: ['packages/**/*.{js,ts}'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
globals: {
// 浏览器环境
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
// Chrome 扩展 API
chrome: 'readonly',
},
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
},
plugins: {
prettier: prettierPlugin,
},
},
];