-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
80 lines (80 loc) · 2.5 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
77
78
79
80
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['airbnb-typescript/base'],
parserOptions: {
project: './tsconfig.json'
},
rules: {
// TypeScript
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/comma-dangle': ['error', 'never'],
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/prefer-reduce-type-parameter': ['error'],
'@typescript-eslint/promise-function-async': ['error'],
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }],
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/strict-boolean-expressions': ['error', {
allowNullableBoolean: true,
allowNullableString: true
}],
'@typescript-eslint/naming-convention': ['error', {
// Enforce camelCase
selector: 'variableLike',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow'
}, {
// Ignore imports
selector: 'variable',
format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
modifiers: ['global']
}, {
// Enforce underscore on private members
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require'
}, {
// Enforce PascalCase on types / interfaces
selector: 'typeLike',
format: ['PascalCase']
}],
'@typescript-eslint/indent': ['error', 2, {
SwitchCase: 1,
ignoredNodes: ['TSTypeParameterInstantiation']
}],
// General
'operator-linebreak': ['error', 'after'],
'linebreak-style': 'off',
'no-confusing-arrow': 'off',
'no-restricted-syntax': 'off',
'comma-dangle': 'off',
'arrow-body-style': 'warn',
'max-len': ['error', {
code: 100,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreComments: true
}],
'arrow-parens': ['error', 'as-needed'],
'implicit-arrow-linebreak': 'off',
'no-underscore-dangle': 'off',
'no-await-in-loop': 'off',
'object-curly-newline': ['warn', {
ObjectPattern: { minProperties: 4 },
ImportDeclaration: { minProperties: 4 }
}],
// Import
'import/prefer-default-export': 'off',
'import/order': ['error', {
'newlines-between': 'always',
groups: [
['builtin', 'external'],
'internal',
['parent', 'sibling'],
'index'
]
}]
}
};