-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
133 lines (115 loc) · 3.5 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
module.exports = {
ignorePatterns: ['static/', 'collected_static/'],
root: true,
env: {
node: true,
browser: true,
},
plugins: ['vue'],
globals: {
vue: 'readonly',
},
extends: ['plugin:vue/vue3-recommended', 'airbnb-base'],
settings: {
'import/resolver': 'webpack',
},
rules: {
'no-console': 'off',
'no-restricted-syntax': 'error',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// Allow ternary statements
'no-unused-expressions': ['error', {allowTernary: true}],
// Max line length
'max-len': ['error', 380, 4],
// Allow parameter attributes to be reassigned
'no-param-reassign': ['error', {props: false}],
// Prefer const over let
'prefer-const': 0,
// misc
'no-multiple-empty-lines': [2, {max: 1, maxEOF: 0, maxBOF: 0}],
'linebreak-style': ['off', 'unix'],
'import/extensions': ['error', 'ignorePackages', {js: 'never', vue: 'never', scss: 'never'}],
'no-control-regex': 0,
'no-plusplus': [2, {allowForLoopAfterthoughts: true}],
// disallow empty functions, except for standalone funcs/arrows
// https://eslint.org/docs/rules/no-empty-function
'no-empty-function': ['error', {allow: []}],
// >>> PEARS requests
// allow `new Vue()` without assigning to a variable
'no-new': 0,
// just one var declaration per function
'one-var': ['error', 'consecutive'],
// require or disallow space before function opening parenthesis
// https://eslint.org/docs/rules/space-before-function-paren
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
// spacing
'object-curly-spacing': ['error', 'never'],
// this option sets a specific tab width for your code
// https://eslint.org/docs/rules/indent
indent: [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 'first',
outerIIFEBody: 1,
// MemberExpression: null,
FunctionDeclaration: {
parameters: 1,
body: 1,
},
FunctionExpression: {
parameters: 1,
body: 1,
},
CallExpression: {
arguments: 1,
},
ArrayExpression: 1,
ObjectExpression: 1,
ImportDeclaration: 1,
flatTernaryExpressions: false,
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
ignoredNodes: [
'JSXElement',
'JSXElement > *',
'JSXAttribute',
'JSXIdentifier',
'JSXNamespacedName',
'JSXMemberExpression',
'JSXSpreadAttribute',
'JSXExpressionContainer',
'JSXOpeningElement',
'JSXClosingElement',
'JSXText',
'JSXEmptyExpression',
'JSXSpreadChild',
],
ignoreComments: false,
},
],
// put runtime deps in devDependancies also since the package is getting rolled up w/ webpack
'import/no-extraneous-dependencies': ['error', {devDependencies: true}],
// We don't care about this
'import/prefer-default-export': 'off',
// Make it allow multiple attributes per line
'vue/max-attributes-per-line': [
'error',
{
singleline: 6,
multiline: 1,
},
],
// allow no name functions in some cases
'func-names': ['error', 'never'],
// TEMPORARY - allow v-html for now until we do clean-html directive
'vue/no-v-html': ['off'],
},
};