-
-
Notifications
You must be signed in to change notification settings - Fork 749
/
.eslintrc.js
55 lines (55 loc) · 1.73 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
// 参考 https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended", "prettier"],
rules: {
"no-console": "off",
"no-debugger": "off",
"no-unused-vars": "warn",
"no-useless-escape": "off",
// plugin:vue/recommended 规则
"vue/attributes-order": "error",
"vue/html-quotes": ["error", "double"],
// plugin:vue/strongly-recommended 规则
"vue/attribute-hyphenation": ["error", "always"],
"vue/html-end-tags": "error",
"vue/html-indent": "off",
"vue/require-default-prop": "error",
"vue/require-prop-types": "error",
"vue/jsx-uses-vars": "error",
"consistent-this": ["error", "that"], // this别名
"vue/order-in-components": [
"error",
{
// methods 顺序和 官网推荐稍有不同
order: [
"el",
"name",
"parent",
"functional",
["delimiters", "comments"],
["components", "directives", "filters"],
"extends",
"mixins",
"inheritAttrs",
"model",
["props", "propsData"],
"data",
"computed",
"watch",
"methods",
"LIFECYCLE_HOOKS",
["template", "render"],
"renderError",
],
},
],
},
parserOptions: {
parser: "babel-eslint",
},
globals: {},
};