-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.eslintrc.js
54 lines (54 loc) · 1.53 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
// 创建这个文件的话,本王推荐用eslint --init创建
module.exports = {
"env": {
"browser": true,
"node": true,
"es6": true
},
// https://stackoverflow.com/questions/38296761/how-to-support-es7-in-eslint
// 为了让eslint支持es7或更高的语法
// "parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:vue/recommended"
],
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"plugins": [
// https://github.com/BenoitZugmeyer/eslint-plugin-html
// 支持 *.vue lint
// "html"
"vue"
],
// https://eslint.org/docs/rules/
"rules": {
"indent": [
"error",
2
],
"linebreak-style": 0,
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
],
"no-trailing-spaces": [
"error",
{ "skipBlankLines": true }
],
// https://eslint.org/docs/user-guide/configuring#using-configuration-files
// "off" or 0 - turn the rule off
// "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
// "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"no-console": 0,
// vue rules
"vue/html-self-closing": 0,
"vue/component-name-in-template-casing": 0
}
};