-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
55 lines (54 loc) · 1.79 KB
/
.eslintrc.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
51
52
53
54
55
// @ts-check
const path = require('path');
const rootDir = path.resolve(__dirname);
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'eslint:recommended',
// https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/docs/getting-started/linting/README.md
'plugin:@typescript-eslint/recommended',
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
'plugin:ava/recommended',
],
env: {
browser: true,
es2021: true,
node: true,
},
globals: {
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: rootDir,
project: path.resolve(rootDir, './tsconfig.eslint.json'),
projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**', '**/dist-admin/**'],
warnOnUnsupportedTypeScriptVersion: false,
// createDefaultProgram: true,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
ignorePatterns: [
'**/node_modules/**',
'dist/**',
'build/**',
'mock/**',
'**/*.js',
'**/*.d.ts',
],
rules: {
'prettier/prettier': 'warn',
// 关闭 eslint 的 indent,使用 prettier 格式化格式
indent: ['off', 2],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'ava/no-ignored-test-files': 'off',
},
};