-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
112 lines (111 loc) · 3.54 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [ 'import', 'sort-keys-fix' ],
root: true,
rules: {
'@typescript-eslint/indent': [
'error',
2,
{
ignoredNodes: [ 'TSTypeParameterInstantiation' ],
SwitchCase: 1,
},
],
'@typescript-eslint/member-ordering': [ 'error', {
classes: [
'private-field',
'protected-field',
'public-field',
'private-method',
'protected-method',
'public-field',
],
interfaces: { order: 'alphabetically' },
typeLiterals: { order: 'alphabetically' },
} ],
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'after-used', ignoreRestSiblings: true },
],
'@typescript-eslint/prefer-optional-chain': [ 'error' ],
'array-bracket-spacing': [ 'error', 'always' ],
'array-element-newline': [ 'error', 'consistent' ],
'arrow-spacing': [ 'error', { after: true, before: true } ],
'block-spacing': [ 'error', 'always' ],
'brace-style': [ 'error', '1tbs', { allowSingleLine: true } ],
'comma-dangle': [ 'error', 'always-multiline' ],
'comma-spacing': [ 'error', { after: true, before: false } ],
'eol-last': [ 'error', 'always' ],
'eqeqeq': [ 'error', 'smart' ],
'function-paren-newline': [ 'error', 'multiline-arguments' ],
'import/order': [ 'error', {
'alphabetize': { caseInsensitive: true, order: 'asc' },
'groups': [ 'builtin', 'external', 'internal', 'parent', 'sibling', 'index' ],
'newlines-between': 'always',
} ],
'indent': 'off',
'jsx-quotes': [ 'error', 'prefer-double' ],
'key-spacing': [ 'error', {
multiLine: {
afterColon: true,
beforeColon: false,
mode: 'strict',
},
singleLine: {
afterColon: true,
beforeColon: false,
},
} ],
'max-len': [ 'error', 120, { tabWidth: 2 } ],
'no-console': [ 'error', { allow: [ 'warn' ] } ],
'no-empty': [ 'error', { allowEmptyCatch: true } ],
'no-multi-spaces': [ 'error', { ignoreEOLComments: true } ],
'no-multiple-empty-lines': [ 'error', { max: 1, maxBOF: 0, maxEOF: 0 } ],
'no-trailing-spaces': [ 'error', {} ],
'no-unused-vars': 'off',
'object-curly-newline': [ 'error', {
ExportDeclaration: { consistent: true },
ImportDeclaration: { consistent: true },
ObjectExpression: { multiline: true },
ObjectPattern: { multiline: true },
} ],
'object-curly-spacing': [ 'error', 'always' ],
'object-property-newline': [ 'error', { allowAllPropertiesOnSameLine: true } ],
'quote-props': [ 'error', 'consistent-as-needed' ],
'quotes': [ 'error', 'single', { avoidEscape: true } ],
'require-await': 'error',
'semi': [ 'error', 'always' ],
'sort-imports': [ 'error', {
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
} ],
'sort-keys-fix/sort-keys-fix': [ 'error', 'asc', {
caseSensitive: false,
natural: true,
} ],
'space-in-parens': [ 'error', 'never' ],
'space-infix-ops': [ 'error', { int32Hint: true } ],
},
// This loads <rootdir>/tsconfig.json to eslint
settings: { 'import/resolver': { typescript: {} } },
};