-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
131 lines (131 loc) · 4.57 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
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
123
124
125
126
127
128
129
130
131
module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/recommended'
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2017,
sourceType: 'module',
allowImportExportEverywhere: true
},
rules: {
'indent': ['error', 4, { 'SwitchCase': 1, 'MemberExpression': 1 }],
'no-trailing-spaces': 'error',
'no-console': process.env.NODE_ENV === 'production' ? [
'error',
{ 'allow': ['warn', 'error'] },
] : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-fallthrough': 'off',
'no-case-declarations': 'off',
'space-before-function-paren': 'error',
'spaced-comment': 'error',
'arrow-spacing': 'error',
'keyword-spacing': 'error',
'semi': ['error', 'always'],
'dot-location': ['error', 'property'],
'dot-notation': 'error',
'no-alert': 'off',
'eqeqeq': ['error', 'always'],
'no-floating-decimal': 'error',
'no-global-assign': 'error',
'no-multi-spaces': 'error',
'no-useless-return': 'error',
'no-undef-init': 'warn',
'no-use-before-define': ['error', { 'functions': false }],
'array-bracket-newline': ['error', 'consistent'],
'brace-style': ['error', '1tbs'],
'comma-dangle': [ 'error', 'always-multiline' ],
'comma-spacing': 'error',
'comma-style': 'error',
'eol-last': 'error',
'func-call-spacing': 'error',
'jsx-quotes': ['error', 'prefer-double'],
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'quote-props': ['error', 'as-needed'],
'linebreak-style': 'warn',
'lines-around-comment': 'warn',
'max-depth': ['error', 3],
'max-statements-per-line': 'error',
'newline-per-chained-call': 'error',
'no-lonely-if': 'error',
'no-mixed-operators': 'warn',
'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0, 'maxBOF': 0 }],
'no-tabs': 'warn',
'space-before-blocks': 'error',
'space-infix-ops': 'error',
'space-unary-ops': [2, {
'words': true,
'nonwords': true,
'overrides': {
'-': false,
'++': false,
'--': false,
},
}],
'space-in-parens': 'error',
'switch-colon-spacing': 'error',
'arrow-body-style': 'error',
'no-duplicate-imports': 'warn',
'no-useless-computed-key': 'warn',
'no-var': 'error',
'arrow-parens': ['error', 'as-needed'],
'curly': 'error',
'vue/no-dupe-keys': 'error',
'vue/no-reserved-keys': 'error',
'vue/no-shared-component-data': 'error',
'vue/require-valid-default-prop': 'error',
'vue/require-default-prop': 'error',
'vue/require-prop-types': 'error',
'vue/this-in-template': 'error',
'vue/return-in-computed-property': 'error',
'vue/html-quotes': 'error',
'vue/order-in-components': [2, {
'order': [
['name', 'delimiters', 'functional', 'extends'],
'el',
['components', 'directives', 'filters'],
['parent', 'mixins', 'provide', 'inject'],
'template',
'model',
'props',
'propsData',
'data',
'chill',
'computed',
'watch',
'methods',
'LIFECYCLE_HOOKS',
'render',
'renderError',
],
}],
'vue/max-attributes-per-line': [2, {
'singleline': 2,
'multiline': {
'max': 1,
'allowFirstLine': false,
},
}],
'vue/html-self-closing': ['error', {
'html': {
'void': 'never',
'normal': 'never',
'component': 'never',
},
}],
'vue/html-closing-bracket-newline': ['error', {
'singleline': 'never',
'multiline': 'always',
}],
'vue/html-indent': ['error', 4],
'vue/no-side-effects-in-computed-properties': ['off'],
'vue/attributes-order': ['off'],
'vue/prop-name-casing': ['error', 'camelCase'],
'vue/multiline-html-element-content-newline': ['off'],
'vue/singleline-html-element-content-newline': ['off'],
'vue/no-v-html': ['off'],
},
};