-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.js
82 lines (77 loc) · 2.42 KB
/
base.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
81
82
module.exports = {
plugins: ['import'],
rules: {
// -- Generic rules
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-unresolved': 'off',
'newline-before-return': 'error',
'no-console': ['warn'],
'no-restricted-syntax': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'off',
'no-return-assign': ['error', 'except-parens'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'@typescript-eslint/return-await': 'off',
// -- No default exports
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
// -- Code formatting
indent: 'off',
'@typescript-eslint/indent': [
'error',
2,
{
SwitchCase: 1,
ignoredNodes: [
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key',
],
},
],
'@typescript-eslint/type-annotation-spacing': [
'error',
{ before: false, after: true, overrides: { arrow: { before: true, after: true } } },
],
'@typescript-eslint/member-delimiter-style': 'error',
'eol-last': ['error', 'always'],
'no-trailing-spaces': ['error'],
'array-bracket-spacing': ['error', 'never'],
'comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'max-len': [
'error',
{
code: 100,
ignoreComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1, maxBOF: 0 }],
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: false }],
curly: ['error', 'all'],
'key-spacing': 'error',
// -- Typescript
'@typescript-eslint/ban-types': [
'error',
{
types: {
String: { message: 'Use string instead', fixWith: 'string' },
Number: { message: 'Use number instead', fixWith: 'number' },
Boolean: { message: 'Use boolean instead', fixWith: 'boolean' },
},
},
],
'@typescript-eslint/no-namespace': 'error',
},
overrides: [
{
files: ['src/**/*.spec.ts', 'src/**/*.spec.tsx'],
rules: {
'max-len': 'off',
},
},
],
};