forked from cuttle-cards/cuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
124 lines (124 loc) · 3.02 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
const sharedTestRules = {
'import/no-unresolved': ['off'],
};
module.exports = {
root: true,
env: {
es2021: true,
node: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
extends: ['eslint:recommended', 'plugin:vue/base', 'plugin:vuetify/base'],
plugins: ['cypress', 'vitest', 'prettier'],
ignorePatterns: ['/node_modules/*', '/assets/*'],
rules: {
'max-len': [
'warn',
{
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
},
],
'vue/html-indent': ['error'],
'vue/multi-word-component-names': ['error'],
'prefer-destructuring': ['error'],
'no-else-return': [
'error',
{
allowElseIf: true,
},
],
'no-case-declarations': 'error',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
semi: ['error', 'always'],
'vue/html-closing-bracket-newline': ['error', {
'singleline': 'never',
'multiline': 'always'
}],
'vue/max-attributes-per-line': ['error', {
'singleline': {
'max': 3
},
'multiline': {
'max': 1
}
}],
'vue/first-attribute-linebreak': ['error', {
'singleline': 'beside',
'multiline': 'below'
}],
},
overrides: [
{
files: ['**/client/**/*.{j,t}s?(x)'],
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:vue/recommended'],
rules: {
'no-undef': 'error',
'no-prototype-builtins': 'error',
'no-case-declarations': 'error',
},
},
// Storybook specific rules
{
files: ['**/(.storybook|stories)/**/*.{j,t}s?(x)'],
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:storybook/recommended'],
rules: {
'no-undef': 'error',
'no-prototype-builtins': 'error',
},
},
// Sails specific rules
{
files: ['**/api/**/*.{j,t}s?(x)'],
globals: {
_: true,
sails: true,
cardService: true,
gameService: true,
userService: true,
//
Card: true,
Season: true,
Match: true,
User: true,
Game: true,
UserSpectatingGame: true,
},
rules: {
'no-undef': 'error',
'no-prototype-builtins': 'error',
},
},
// Vittest specific rules
{
files: ['**/tests/unit/**/*.{j,t}s?(x)'],
rules: sharedTestRules,
},
// Cypress specific rules
{
files: ['**/tests/e2e/**/*.{j,t}s?(x)'],
env: {
'cypress/globals': true,
},
globals: {
badRequest: true,
cardService: true,
io: true,
ready1: true,
request: true,
socket1: true,
socket2: true,
socket3: true,
Promise: true,
},
rules: sharedTestRules,
},
],
};