-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
36 lines (36 loc) · 998 Bytes
/
.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
module.exports = {
parser: '@typescript-eslint/parser', // 定义ESLint的解析器
// 定义文件继承的子规范
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'plugin:jest/recommended',
// prettier related setup
'plugin:prettier/recommended',
'prettier/@typescript-eslint'
],
// 指定代码的运行环境
env: {
browser: true,
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},
rules: {
"import/prefer-default-export": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false, classes: true, variables: true, typedefs: true },
],
}
};