-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
195 lines (189 loc) · 5.04 KB
/
config.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
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
},
parser: "@typescript-eslint/parser",
},
extends: [
/** More */
"plugin:regexp/all", // Regulars
"plugin:optimize-regex/all", // Regulars
"plugin:lodash/recommended", // Makes you use lodash
"plugin:promise/recommended", // Promises
"plugin:import/recommended", // Import
"plugin:import/typescript", // Typescript import
"plugin:eslint-comments/recommended", // Eslint comments
/** Packs */
"airbnb-base",
"plugin:sonarjs/recommended",
"plugin:unicorn/all",
"google",
"prettier", // Prettier
/** Security */
"plugin:no-unsanitized/recommended-legacy",
// "plugin:security/recommended",
"plugin:jsonc/base",
/** Core nuxt */
"plugin:jsx-a11y/strict", // Jsx
"plugin:@typescript-eslint/recommended",
"plugin:nuxt/recommended",
"plugin:vue/vue3-recommended",
],
plugins: [
/** Security */
"no-secrets",
"xss",
"react",
"@typescript-eslint",
],
ignorePatterns: [
"static/sw.js",
"node_modules",
".nuxt",
"dist",
"src/types/backend/backendApi.ts",
],
settings: {
"import/resolver": {
typescript: true,
node: {
extensions: [".js", ".jsx", ".ts", ".tsx", "vue"],
},
},
},
rules: {
// # On.
// ## Standart eslint.
// Line end format
"linebreak-style": ["error", "unix"],
// Comma at the end of the line
"comma-dangle": ["warn", "always-multiline"],
"eol-last": "warn",
quotes: ["error", "double", { avoidEscape: true }],
"no-duplicate-imports": "error",
// Acces console debug, coze nuxt delete them in build.
"no-console": ["warn", { allow: ["debug", "error", "warn"] }],
camelcase: "warn",
// ## Security.
"no-secrets/no-secrets": "error",
"xss/no-mixed-html": "error",
"xss/no-location-href-assign": "error",
// ## Other
// All old files wrote wrong.
"unicorn/filename-case": [
"error",
{
cases: {
kebabCase: true,
camelCase: true,
snakeCase: true,
pascalCase: true,
},
},
],
// Disable function for use step-down structure.
"no-use-before-define": [
"error",
{
functions: false,
classes: true,
variables: true,
},
],
"import/no-duplicates": "warn",
// # Off.
// Use v-html.
"vue/no-v-html": "off",
// Dont use lodash instead of default js function.
"lodash/prefer-lodash-method": "off",
// Not write jsdoc comments.
"require-jsdoc": "off",
"valid-jsdoc": "off",
// He get clear text without space and enlines.
"unicorn/prefer-dom-node-text-content": "off",
/** Acces get value by dinamic key. Need control, what
key was't got from user input.
*/
"security/detect-object-injection": "off",
// Fix wrong work no-shadow in ts.
"no-shadow": "off",
// Need for correct work no-shadow too.
"@typescript-eslint/no-shadow": "error",
// Dont use file format in import.
"import/extensions": "off",
// Delete leter.
"vue/multi-word-component-names": "off",
// Build with no use variables.
"import/no-extraneous-dependencies": "off",
"no-restricted-syntax": "off",
"import/prefer-default-export": "off",
"no-undef": "off",
// Conflict with typescript and maybe slow.
"unicorn/prefer-json-parse-buffer": "off",
"unicorn/no-useless-undefined": "off",
// In typescript need use import/no-duplicates.
"no-duplicate-imports": "off",
// # Change level.
"unicorn/consistent-function-scoping": "warn",
// Order
"react/jsx-sort-props": "warn",
// Change error to wart. This most build in dev with this.
"@typescript-eslint/no-unused-vars": "warn",
// # For vue template
// "max-len": [
// "warn",
// {
// code: 79,
// ignoreUrls: true,
// ignoreStrings: true,
// },
// ],
"max-len": "off",
// Acces long strings in template.
"vue/max-len": "off",
"vue/html-self-closing": [
"error",
{
html: { normal: "always", void: "always" },
svg: "always",
math: "always",
},
],
// Prettier confilict with this rule in self closed
// tags.
// "vue/html-closing-bracket-newline": [
// "error",
// {
// singleline: "never",
// multiline: "always",
// selfClosingTag: {
// singleline: "never",
// multiline: "never",
// },
// },
// ],
// Dont need default props if require is true
"vue/require-default-prop": "off",
"vue/max-attributes-per-line": [
2,
{
singleline: 20,
multiline: {
max: 2,
},
},
],
"vue/singleline-html-element-content-newline": "off",
// Prettier confilict in multiline v-if.
"vue/html-indent": "off",
},
}