-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
146 lines (113 loc) · 4.83 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
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:cypress/recommended',
'plugin:vue/recommended',
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
/*
* AirBnB JS rule overrides.
*/
// Enforce consistent indentation.
indent: [ 'error', 4, {
SwitchCase: 1,
// Fix issue with `Cannot read property 'range' of null` errors. Please see
// https://stackoverflow.com/questions/48391913/eslint-error-cannot-read-property-range-of-null
// for more information.
ignoredNodes: [ 'TemplateLiteral' ],
} ],
// Fix issue with `Cannot read property 'range' of null` errors. Please see
// https://stackoverflow.com/questions/48391913/eslint-error-cannot-read-property-range-of-null
// for more information.
'template-curly-spacing': 'off',
// Allow unnecessarily quoted properties.
'quote-props': 'off',
// Allow dangling underscores to indicate private methods (like _internalMethod()).
'no-underscore-dangle': 'off',
// Enforce a maximum line length.
'max-len': [ 'error', { 'code': 120 } ],
// Don't try to resolve the dependencies.
'import/no-unresolved': 'off',
// Allow for missing file extensions in import statements.
'import/extensions': 'off',
// Allow for dependencies to not be in project configuration.
'import/no-extraneous-dependencies': 'off',
// Require a space before function parenthesis.
'space-before-function-paren': [ 'error', 'always' ],
// Require "Stroustrup" brace style.
'brace-style': [ 'error', 'stroustrup' ],
// Enforce spaces inside of brackets.
'array-bracket-spacing': [ 'error', 'always' ],
// Do not enforce that class methods utilize this.
'class-methods-use-this': 'off',
// Allow the unary operators ++ and --.
'no-plusplus': 'off',
// Allow Reassignment of Function Parameters.
'no-param-reassign': 'off',
// Allow usage of continue statement.
'no-continue': 'off',
// Enforce consistent line breaks inside function parentheses.
'function-paren-newline': [ 'error', 'consistent' ],
// Ignore trailing commas in the imports, exports and functions, but require it in arrays and object
// definitions.
'comma-dangle': [
'error',
{
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'ignore',
'exports': 'ignore',
'functions': 'ignore',
},
],
// Do not force the use of the object spread just yet (target ES2018).
'prefer-object-spread': 'off',
// Do not force parentheses on arrow functions with single arguments.
'arrow-parens': 'off',
// Allow require() calls with expressions (dynamic imports).
'import/no-dynamic-require': 'off',
// Disable newline requirement for object curly syntax.
'object-curly-newline': 'off',
// Allow usage of console and debugger in dev mode.
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
/*
* Vue.js rule overrides.
*/
// Enforce consistent indentation in <template>.
'vue/html-indent': [ 'error', 4 ],
// Enforce v-bind directive usage in long form.
'vue/v-bind-style': [ 'error', 'longform' ],
// Enforce v-on directive usage in long form.
'vue/v-on-style': [ 'error', 'longform' ],
// Don't require default value for props.
'vue/require-default-prop': 'off',
// Don't warn about unused components. This is sometime needed for dynamic component usage.
'vue/no-unused-components': 'off',
// Don't correct casing of component names for backward compatibility reasons.
'vue/component-name-in-template-casing': 'off',
// Don't correct closing bracket position of HTML tags for backward compatibility reasons.
'vue/html-closing-bracket-newline': 'off',
// Don't correct new lines in single line HTML elements for backward compatibility reasons.
'vue/singleline-html-element-content-newline': 'off',
// Don't enforce FOR attributes for LABEL elements, since the plugin doesn't detect binding syntax.
'vuejs-accessibility/label-has-for': 'off',
},
overrides: [
{
files: [
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};