This repository has been archived by the owner on Aug 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
60 lines (60 loc) · 1.67 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
56
57
58
59
60
// Consider running ESLint debug
// npx eslint --debug /Users/pleasurazy/git/life/packages/bot/.eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
env: {
node: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
// 提升可靠性,但沒有也沒關係。
'@typescript-eslint/no-explicit-any': 'off',
// 提升可靠性,但沒有也沒關係。
'@typescript-eslint/explicit-function-return-type': 'off',
// 提升可靠性,但沒有也沒關係。
'@typescript-eslint/require-await': 'off',
// 適當的 unused-vars 幫助我們快速理解有哪些可用的參數
'@typescript-eslint/no-unused-vars': 'off',
// 分號由 prettier 解決
'@typescript-eslint/member-delimiter-style': 'off',
// 誤用 return promise 之規則
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/unbound-method': 'warn',
// TypeScript Assertion Function 可以不需要 stataments
'@typescript-eslint/no-empty-function': 'warn',
},
overrides: [
{
files: ['**/webpack.config.ts'],
parserOptions: {
project: 'tsconfig.webpack.json',
},
},
{
files: ['**/*.test.js'],
env: {
jest: true,
},
},
{
files: ['*.js'],
parser: 'babel-eslint',
},
],
}