-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path.eslintrc.js
57 lines (57 loc) · 1.44 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
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
//想使用的额外的语言特性:
ecmaFeatures: {
parser: 'babel-eslint',
// 允许在全局作用域下使用 return 语句
globalReturn: true,
// impliedStric 严格模式
impliedStrict: true,
// 启用 JSX
jsx: true,
// experimentalObjectRestSpread: true,
modules: true
}
},
env: {
browser: true,
commonjs: true,
node: true,
es6: true
},
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2018
},
rules: {
'no-console': [0],
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
// 要求或禁止使用分号而不是 ASI(这个才是控制行尾部分号的,)
semi: [2, 'never'],
// 强制使用一致的反勾号、双引号或单引号
quotes: [2, 'single', 'avoid-escape'],
'prettier/prettier': [
'error',
{
singleQuote: true,
printWidth: 120,
tabWidth: 2,
semi: false,
trailingComma: 'none',
arrowParens: 'avoid',
bracketSpacing: true,
bracesSpacing: true,
jsxBracketSameLine: true
// insertPragma: true,
// requirePragma: false
}
]
}
}