-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.eslintrc.js
More file actions
33 lines (33 loc) · 1.01 KB
/
.eslintrc.js
File metadata and controls
33 lines (33 loc) · 1.01 KB
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
module.exports = {
root: true, // "root": true 配置项表示代码规范的校验范围,停止向上查找
env: {
es6: true,
amd: true,
browser: true,
commonjs: true,
node: true,
jest: true
},
extends: ['eslint:recommended', 'react-app'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-unused-vars': 'warn'
},
parser: '@babel/eslint-parser', // parser指定解析器,默认的为espree。babel-eslint是一个Babel parser的包装器,这个包装器使得 Babel parser 可以和 ESLint 协调工作
parserOptions: {
sourceType: 'module', // 设置为 "script" (默认) 或 "module"(ES6)。
ecmaFeatures: {
// 这是个对象,表示你想使用的额外的语言特性:
jsx: true // 启用 JSX
}
},
globals: {
cdq: false,
basename: false,
log: false,
error: false,
globalThis: false
},
plugins: ['react']
}