forked from BinarCode/vue2-transitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
196 lines (182 loc) · 4.91 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
module.exports = {
root: true,
ignorePatterns: [
'aem/',
'dist/',
],
extends: [
'eslint:recommended',
'plugin:vue/essential',
],
parserOptions: {
// parser: 'babel-eslint',
sourceType: 'module',
// ecmaVersion: 11,
},
env: {
node: true,
browser: true,
es2020: true,
},
rules: {
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'vue/no-unused-vars': 'off',
'vue/no-unused-components': 'warn',
'indent': ['error', 'tab', {
'SwitchCase': 1,
'MemberExpression': 'off',
}],
'comma-dangle': ['error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'always-multiline',
'exports': 'always-multiline',
'functions': 'only-multiline',
}],
'no-cond-assign': ['error', 'always'],
'no-console': 'off',
'no-debugger': 'warn',
'no-alert': 'warn',
'no-undef': 'off', // warn
'no-unused-vars': ['warn', {
'varsIgnorePattern': '^(context)$',
'vars': 'local',
'args': 'none',
'ignoreRestSiblings': true,
}],
'no-var': ['error'],
'no-await-in-loop': ['error'],
'no-promise-executor-return': ['error'],
'no-template-curly-in-string': ['warn'],
'no-unsafe-optional-chaining': ['error'],
'require-atomic-updates': ['error'],
// best practice
'array-callback-return': ['error'],
'accessor-pairs': ['error'],
'block-scoped-var': ['error'],
'curly': ['error', 'multi-line', 'consistent'],
'default-param-last': ['error'],
'dot-location': ['error', 'property'],
'grouped-accessor-pairs': ['error'],
'no-constructor-return': ['error'],
'no-div-regex': ['error'],
'no-empty-function': ['warn', {
'allow': ['methods', 'generatorMethods', 'getters', 'setters', 'constructors'],
}],
'no-eq-null': ['error'],
'no-extend-native': ['error'],
'no-extra-bind': ['warn'],
'no-floating-decimal': ['error'],
'no-implicit-globals': ['error'],
'no-implied-eval': ['error'],
'no-invalid-this': ['error'],
'no-iterator': ['error'],
'no-labels': ['error'],
'no-lone-blocks': ['error'],
'no-multi-spaces': ['error'],
'no-loop-func': ['error'],
'no-multi-str': ['error'],
'no-new': ['error'],
'no-new-func': ['error'],
'no-new-wrappers': ['error'],
'no-octal': ['error'],
'no-octal-escape': ['error'],
'no-param-reassign': ['error'],
'no-proto': ['error'],
'no-return-assign': ['error', 'always'],
'no-return-await': ['error'],
'no-script-url': ['error'],
'no-self-compare': ['error'],
'no-sequences': ['error'],
'no-throw-literal': ['error'],
'no-unmodified-loop-condition': ['error'],
'no-unused-expressions': ['warn'],
'no-useless-call': ['warn'],
// 'no-useless-catch': ['warn'],
'no-useless-concat': ['warn'],
// 'no-useless-return': ['warn'],
'no-useless-escape': ['warn'],
'no-void': ['error'],
'no-with': ['error'],
'prefer-regex-literals': ['error'],
'require-await': ['warn'],
'yoda': ['warn', 'never', {
'exceptRange': true,
}],
'prefer-promise-reject-errors': ['warn'],
'wrap-iife': ['error', 'inside'],
'no-undefined': ['error'],
'no-use-before-define': ['error'],
// stylistic
'brace-style': ['error', '1tbs', {
'allowSingleLine': true,
}],
'comma-spacing': ['warn', {
'before': false,
'after': true,
}],
'consistent-this': ['error', 'context'],
'func-call-spacing': ['error', 'never'],
'implicit-arrow-linebreak': ['error', 'beside'],
'key-spacing': ['error', {
'beforeColon': false,
'afterColon': true,
}],
'keyword-spacing': ['error', {
'before': true,
'after': true,
}],
'max-params': ['warn', 6],
'no-bitwise': ['error'],
'no-mixed-operators': ['error'],
'no-multi-assign': ['warn'],
'no-new-object': ['error'],
'no-trailing-spaces': ['warn', {
'skipBlankLines': true,
'ignoreComments': true,
}],
'no-whitespace-before-property': ['error'],
'nonblock-statement-body-position': ['error', 'beside'],
'one-var': ['error', 'never'],
'one-var-declaration-per-line': ['error', 'always'],
'prefer-exponentiation-operator': ['warn'],
'prefer-object-spread': ['warn'],
'no-extra-semi': ['error'],
// 'semi-style': ['error', 'last'],
'semi-spacing': ['error', {
'before': false,
'after': true,
}],
'semi': ['warn', 'always', {
'omitLastInOneLineBlock': true,
}],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': 'off', // warn ?
'space-infix-ops': ['warn'],
'space-unary-ops': ['error', {
'words': true,
'nonwords': false,
}],
'spaced-comment': ['warn', 'always'],
'switch-colon-spacing': ['error', {
'after': true,
'before': false,
}],
'template-tag-spacing': ['error', 'never'],
// ES6
'arrow-spacing': ['error', {
'before': true,
'after': true,
}],
'generator-star-spacing': ['error', {
'before': false,
'after': true,
}],
'no-confusing-arrow': ['error', {
'allowParens': true,
}],
'no-duplicate-imports': ['warn'],
'prefer-template': ['warn'],
'rest-spread-spacing': ['error', 'never'],
},
}