-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.js
122 lines (110 loc) · 3.1 KB
/
vue.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
module.exports = {
parser: 'vue-eslint-parser',
// https://eslint.org/docs/user-guide/configuring#specifying-parser-options
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#bulb-rules
'plugin:vue/strongly-recommended',
// standard + prettier
'./index.js',
],
rules: {
// Disable check of attribute hyphenation
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/attribute-hyphenation.md
'vue/attribute-hyphenation': 'off',
// Enforce PascalCase component names in templates
// https://vuejs.org/v2/style-guide/#Component-name-casing-in-templates-strongly-recommended
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{
ignores: [
'component',
'template',
'transition',
'transition-group',
'keep-alive',
'slot',
'router-view',
'router-link',
'no-ssr',
'nuxt',
'nuxt-link',
'nuxt-child',
],
},
],
// Set html indent to `2` spaces
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-indent.md
'vue/html-indent': [
'error',
2,
{
attribute: 1,
closeBracket: 0,
alignAttributesVertically: true,
ignores: [],
},
],
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md
'vue/html-self-closing': [
'error',
{
html: {
// Enforce self-closing on HTML void elements (<img/>)
void: 'always',
normal: 'always',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'always',
},
],
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-attributes-per-line.md
'vue/max-attributes-per-line': [
'error',
{
// Number of maximum attributes per line when the opening tag is in a single line.
singleline: 5,
// Number of maximum attributes per line when a tag is in multiple lines.
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/multiline-html-element-content-newline.md
'vue/multiline-html-element-content-newline': 'error',
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/singleline-html-element-content-newline.md
'vue/singleline-html-element-content-newline': 'off',
},
globals: {
$nuxt: true,
$fetch: true,
},
overrides: [
{
files: ['**/*.unit.js'],
env: { jest: true },
globals: {
mount: false,
shallowMount: false,
shallowMountView: false,
createComponentMocks: false,
createModuleStore: false,
},
},
],
};