This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
76 lines (75 loc) · 2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const defaultTSOptions = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json'
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'quotes': 'off',
'@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true }],
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-for-in-array': 'error',
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }]
}
}
module.exports = {
extends: ['eslint:recommended'],
env: {
es2020: true,
node: true
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
rules: {
'indent': ['error', 2],
'quotes': ['error', 'single', { avoidEscape: true }],
'linebreak-style': ['error', 'windows'],
'eqeqeq': ['error', 'smart'],
'arrow-parens': ['error', 'always'],
'no-var': 'error',
'no-unneeded-ternary': 'error',
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}]
},
overrides: [
{
files: ['*.ts'],
...defaultTSOptions
},
{
files: ['*.test.ts'],
...defaultTSOptions,
env: {
es2020: true,
node: true,
jest: true
}
}
]
};