-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
121 lines (96 loc) · 2.62 KB
/
.eslintrc.js
File metadata and controls
121 lines (96 loc) · 2.62 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
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
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:vue/recommended',
'plugin:prettier/recommended',
],
// required to lint *.vue files
plugins: ['vue'],
// add your custom rules here
rules: {
/**********************/
/* General Code Rules */
/**********************/
// Enforce import order
'import/order': 'error',
// Imports should come first
'import/first': 'error',
// Other import rules
'import/no-mutable-exports': 'error',
// Allow unresolved imports
'import/no-unresolved': 'off',
// Allow async-await
'generator-star-spacing': 'off',
// Allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 1 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 1 : 0,
// Prefer const over let
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
// No single if in an 'else' block
'no-lonely-if': 'error',
// Force curly braces for control flow,
// including if blocks with a single statement
curly: ['error', 'all'],
// No async function without await
'require-await': 'error',
// Force dot notation when possible
'dot-notation': 'error',
// require let or const instead of var
'no-var': 'error',
// No useless destructuring/importing/exporting renames
'no-useless-rename': 'error',
// Force object shorthand where possible
'object-shorthand': ['off', 'consistent'],
// Disallow use of Object.prototypes builtins directly
'no-prototype-builtins': 'off',
// Disallow Unused Variable
'no-unused-vars': 'warn',
// Disallow unnecessary escape usage
'no-useless-escape': 'off',
'vue/mustache-interpolation-spacing': ['warn', 'always'],
/**********************/
/* Vue Rules */
/**********************/
// Disable template errors regarding invalid end tags
'vue/no-parsing-error': [
'error',
{
'x-invalid-end-tag': false,
},
],
// Maximum 5 attributes per line instead of one
// enforce the maximum number of attributes per line
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'any',
normal: 'any',
component: 'any',
},
svg: 'always',
math: 'always',
},
],
//require a line break before and after the contents of a singleline element
'vue/singleline-html-element-content-newline': 'off',
// enforce tabs in template
'vue/html-indent': ['error', 'tab'],
// enforce tabs in script and js files
indent: ['error', 'tab'],
},
}