-
Notifications
You must be signed in to change notification settings - Fork 22
/
.eslintrc.js
36 lines (35 loc) · 1.17 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
//@ts-check
module.exports = /** @type { import('eslint').Linter.Config } */ ({
root: true,
env: {
node: true,
es6: true,
browser: true,
},
// 指定 ESLint parser
parser: '@typescript-eslint/parser',
extends: [
// 使用 @typescript-eslint/eslint-plugin 中推荐的规则
'plugin:@typescript-eslint/recommended',
// 使用 eslint-config-prettier 来禁止 @typescript-eslint/eslint-plugin 中那些和 prettier 冲突的规则
'prettier/@typescript-eslint',
// 确保下面这行配置是这个数组里的最后一行配置
'plugin:prettier/recommended',
],
rules: {
'import/no-unresolved': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {varsIgnorePattern: '^(h|MODULE|Fragment){1}$'}],
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaversion: 2015, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
tsx: true,
},
},
})