-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
156 lines (156 loc) · 4.36 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
module.exports = {
env: {
node: true,
es2021: true,
},
extends: ['plugin:vue/essential', 'airbnb-base', 'plugin:vue/recommended', 'plugin:vue/strongly-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:storybook/recommended'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
window: true,
Picker: true,
Log: true,
BrowserPolicy: true,
it: true,
describe: true,
before: true,
beforeEach: true,
after: true,
afterEach: true,
require: true,
WebApp: true,
Assets: true,
Cypress: true,
cy: true,
expect: true,
},
plugins: ['vue', '@typescript-eslint'],
rules: {
// Only allow debugger in development
'no-debugger': process.env.PRE_COMMIT ? 'error' : 'off',
// Only allow `console.log` in development
'no-console': process.env.PRE_COMMIT ? ['error', {
allow: ['warn', 'error'],
}] : 'off',
semi: 0,
'import/no-absolute-path': 0,
'import/no-unresolved': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
'import/order': ['error', {
'newlines-between': 'always-and-inside-groups',
}],
'func-names': 0,
'no-await-in-loop': 0,
'no-underscore-dangle': 0,
'consistent-return': 0,
'prefer-destructuring': 0,
camelcase: 0,
quotes: ['error', 'single'],
'vue/array-bracket-spacing': 'error',
'vue/arrow-spacing': 'error',
'vue/block-spacing': 'error',
'vue/brace-style': 'error',
'vue/camelcase': 'error',
'vue/attribute-hyphenation': 0,
'vue/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
'vue/component-name-in-template-casing': 'error',
'vue/dot-location': ['error', 'property'],
'vue/eqeqeq': 'error',
'vue/key-spacing': 'error',
'vue/keyword-spacing': 'error',
'vue/mustache-interpolation-spacing': 'error',
'vue/no-deprecated-scope-attribute': 'error',
'vue/no-empty-pattern': 'error',
'vue/object-curly-spacing': ['error', 'always'],
'vue/padding-line-between-blocks': 'error',
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': 'error',
'vue/v-on-function-call': 'error',
'vue/v-slot-style': ['error', {
atComponent: 'v-slot',
default: 'v-slot',
named: 'longform',
}],
'vue/script-indent': ['error', 2, {
baseIndent: 1,
}],
'vue/html-indent': ['error', 2, {
baseIndent: 1,
}],
'vue/valid-v-slot': 'error',
// allow 'for (let x of n)'
'no-restricted-syntax': [0, 'BinaryExpression[operator=\'of\']'],
'comma-dangle': ['error', 'always-multiline'],
'vue/multi-word-component-names': 0,
'linebreak-style': ['error', 'unix'],
'max-len': ['error', {
code: 120,
tabWidth: 2,
ignoreStrings: true,
ignoreTrailingComments: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
ignorePattern: 'd="([\\s\\S]*?)"',
ignoreRegExpLiterals: true,
ignoreComments: true,
}],
'arrow-parens': ['error', 'as-needed'],
'operator-linebreak': 0,
'implicit-arrow-linebreak': 0,
'no-promise-executor-return': 0,
'semi-style': 0,
'vue/no-multiple-template-root': 1,
'no-unused-expressions': 0,
'no-plusplus': 0,
'vue/no-v-model-argument': 1,
'vue/no-v-for-template-key': 0,
'vue/no-v-for-template-key-on-child': 2,
'vue/html-quotes': 0,
'no-useless-escape': 1,
'no-unused-vars': 'off',
'vue/html-self-closing': 0,
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
}],
'import/no-extraneous-dependencies': 0,
'no-multiple-empty-lines': 0,
'no-use-before-define': ['error', {
variables: false,
}],
},
overrides: [{
files: ['*.vue'],
rules: {
// turn off indent to make sure it doesn't conflict with prettier
indent: 'off',
},
}, {
files: ['*.spec.js'],
rules: {
'no-unused-vars': 0,
},
}, {
files: ['*.test.ts'],
rules: {
'@typescript-eslint/no-non-null-assertion': 0,
},
}, {
files: ['*/**/store/*.js'],
rules: {
'no-param-reassign': 0,
},
}],
};