forked from didi/di18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
161 lines (151 loc) · 3.93 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
module.exports = {
extends: [
'eslint-config-airbnb-base',
'eslint-config-airbnb-base/rules/strict'
].map(require.resolve),
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
modules: true,
}
},
env: {
browser: true,
node: true,
commonjs: true,
es6: true,
jest: true
},
root: true,
rules: {
'class-methods-use-this': ['off', { exceptMethods: [] }],
'guard-for-in': 'off',
'no-alert': 'warn',
'no-div-regex': 'off',
'no-else-return': ['off', { allowElseIf: true }],
'no-implicit-globals': 'off',
'no-loop-func': 'warn',
'no-script-url': 'off',
'no-console': 'off',
'no-var': 'error',
'no-constant-condition': 'off',
'no-case-declarations': 'off',
'prefer-arrow-callback': ['off', {
allowNamedFunctions: false,
allowUnboundThis: true,
}],
'prefer-const': ['off', {
destructuring: 'any',
ignoreReadBeforeAssign: true,
}],
'callback-return': 'off',
'strict': ['off', 'never'],
'indent': ['error', 2, {
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
FunctionDeclaration: {
parameters: 1,
body: 1,
},
FunctionExpression: {
parameters: 1,
body: 1,
},
CallExpression: {
arguments: 1,
},
ArrayExpression: 1,
ObjectExpression: 1,
ImportDeclaration: 1,
flatTernaryExpressions: false,
ignoredNodes: ['JSXElement', 'JSXElement *'],
}],
'jsx-quotes': ['warn', 'prefer-single'],
'keyword-spacing': ['warn', {
before: true,
after: true,
overrides: {
return: { after: true },
throw: { after: true },
case: { after: true },
}
}],
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'off',
'max-depth': ['off', 4],
'max-len': ['off', 100, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'max-lines': ['off', {
max: 300,
skipBlankLines: true,
skipComments: true,
}],
'max-nested-callbacks': 'off',
'max-params': ['warn', 10],
'max-statements': ['off', 10],
'max-statements-per-line': ['off', { max: 1 }],
'multiline-comment-style': ['off', 'starred-block'],
'no-lonely-if': 'off',
'quotes': ['error', 'single', { avoidEscape: true }],
'semi-style': ['error', 'last'],
'semi': ['error', 'always'],
'object-shorthand': ['off', 'always', {
ignoreConstructors: false,
avoidQuotes: true,
}],
'arrow-parens': ['off', 'as-needed', {
requireForBlockBody: true,
}],
'arrow-body-style': 'off',
'no-plusplus': 'off',
'no-param-reassign': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-dynamic-require': 'off',
'import/no-unresolved': 'off',
'prefer-template': 'off',
'prefer-rest-params': 'off',
'radix': 'off',
'no-mixed-operators': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'prefer-destructuring': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'no-prototype-builtins': 'off',
'func-names': 'off',
'no-underscore-dangle': 'off',
'global-require': 'off',
'array-callback-return': 'off',
'quote-props': 'off',
'no-continue': 'off',
'space-before-function-paren': ['error', {
anonymous: 'ignore',
named: 'never',
}],
'complexity': ['warn', { max: 25 }],
'no-shadow': 'off',
'no-await-in-loop': 'off',
'comma-dangle': [
'error',
'always-multiline',
{
arrays: 'never',
objects: 'always',
imports: 'never',
exports: 'never',
functions: 'ignore'
}
]
},
};