@odg/eslint-config 1.5.6 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/index.js +70 -50
- package/package.json +26 -21
- package/rules/any/base.js +5 -0
- package/rules/global/base.js +111 -0
- package/rules/{javascript → global}/errors.js +0 -0
- package/rules/{javascript → global}/possible-errors.js +1 -1
- package/rules/{javascript → global}/security.js +0 -0
- package/rules/ini/base.js +31 -0
- package/rules/javascript/best-practices.js +4 -107
- package/rules/javascript/js-documentation.js +0 -1
- package/rules/json/base.js +6 -0
- package/rules/typescript/best-practices.js +2 -2
- package/rules/typescript/tests.js +3 -0
- package/rules/yaml/base.js +6 -0
package/README.md
CHANGED
|
@@ -544,7 +544,17 @@ Add extends in your `.eslintrc` file
|
|
|
544
544
|
}
|
|
545
545
|
```
|
|
546
546
|
|
|
547
|
-
|
|
547
|
+
Add script in your `package.json` file
|
|
548
|
+
|
|
549
|
+
```json
|
|
550
|
+
{
|
|
551
|
+
"scripts": {
|
|
552
|
+
"lint": "eslint \"**/*.+(js|jsx|ts|tsx|json|jsonc|json5|yml|yaml|xml|txt|svg|properties|gradle|java|cpp|c|cs|html|css|groovy|gitignore|npmignore|toml|env|example|sample|ini|php|bat|powershell|ps1|sh|bash)\"",
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
Test: `npm run lint` or `yarn lint`
|
|
548
558
|
|
|
549
559
|
## File Name Convention
|
|
550
560
|
|
package/index.js
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
node: true,
|
|
4
|
+
browser: true,
|
|
5
|
+
},
|
|
2
6
|
plugins: [
|
|
3
|
-
"
|
|
4
|
-
"jsdoc",
|
|
5
|
-
"promise",
|
|
7
|
+
"json-schema-validator",
|
|
6
8
|
"regexp",
|
|
7
|
-
"
|
|
8
|
-
"security",
|
|
9
|
-
"unicorn",
|
|
10
|
-
"html",
|
|
11
|
-
"n",
|
|
12
|
-
"array-func",
|
|
13
|
-
"no-constructor-bind",
|
|
14
|
-
"anti-trojan-source",
|
|
9
|
+
"import",
|
|
15
10
|
"sonar",
|
|
16
|
-
"regex",
|
|
17
11
|
"sonarjs",
|
|
12
|
+
"security",
|
|
13
|
+
"anti-trojan-source",
|
|
18
14
|
],
|
|
19
|
-
env: {
|
|
20
|
-
node: true,
|
|
21
|
-
browser: true,
|
|
22
|
-
},
|
|
23
15
|
extends: [
|
|
24
|
-
"./rules/
|
|
25
|
-
"./rules/
|
|
26
|
-
"./rules/
|
|
27
|
-
"./rules/
|
|
28
|
-
"./rules/javascript/performance.js",
|
|
29
|
-
"./rules/javascript/possible-errors.js",
|
|
16
|
+
"./rules/global/base.js",
|
|
17
|
+
"./rules/global/errors.js",
|
|
18
|
+
"./rules/global/possible-errors.js",
|
|
19
|
+
"./rules/global/security.js",
|
|
30
20
|
],
|
|
31
21
|
ignorePatterns: [
|
|
32
22
|
"!.*",
|
|
@@ -64,8 +54,7 @@ module.exports = {
|
|
|
64
54
|
".mjs",
|
|
65
55
|
".jsx",
|
|
66
56
|
],
|
|
67
|
-
"import/core-modules": [
|
|
68
|
-
],
|
|
57
|
+
"import/core-modules": [],
|
|
69
58
|
"import/ignore": [
|
|
70
59
|
"node_modules",
|
|
71
60
|
"\\.(coffee|scss|css|less|hbs|svg|json)$",
|
|
@@ -76,6 +65,32 @@ module.exports = {
|
|
|
76
65
|
ecmaVersion: 2022,
|
|
77
66
|
},
|
|
78
67
|
overrides: [
|
|
68
|
+
{
|
|
69
|
+
files: [ "*.js", "*.jsx", "*.mjs", "*.cjs", "*.ts", "*.tsx", "*.mts", "*.cts" ],
|
|
70
|
+
plugins: [
|
|
71
|
+
"import",
|
|
72
|
+
"jsdoc",
|
|
73
|
+
"promise",
|
|
74
|
+
"regexp",
|
|
75
|
+
"filenames",
|
|
76
|
+
"security",
|
|
77
|
+
"unicorn",
|
|
78
|
+
"html",
|
|
79
|
+
"n",
|
|
80
|
+
"array-func",
|
|
81
|
+
"no-constructor-bind",
|
|
82
|
+
"anti-trojan-source",
|
|
83
|
+
"sonar",
|
|
84
|
+
"regex",
|
|
85
|
+
"sonarjs",
|
|
86
|
+
"json-schema-validator",
|
|
87
|
+
],
|
|
88
|
+
extends: [
|
|
89
|
+
"./rules/javascript/best-practices.js",
|
|
90
|
+
"./rules/javascript/js-documentation.js",
|
|
91
|
+
"./rules/javascript/performance.js",
|
|
92
|
+
],
|
|
93
|
+
},
|
|
79
94
|
{
|
|
80
95
|
files: [ "*.ts", "*.tsx", "*.mts", "*.cts" ],
|
|
81
96
|
plugins: [
|
|
@@ -105,27 +120,19 @@ module.exports = {
|
|
|
105
120
|
},
|
|
106
121
|
{
|
|
107
122
|
files: [ "*.json", "*.json5", "*.jsonc", ".eslintrc", "*.code-*" ],
|
|
108
|
-
plugins: [
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
extends: [
|
|
112
|
-
"./rules/json/base.js",
|
|
113
|
-
],
|
|
123
|
+
plugins: [ "jsonc" ],
|
|
124
|
+
extends: [ "./rules/json/base.js" ],
|
|
114
125
|
},
|
|
115
126
|
{
|
|
116
127
|
files: [ "package.json" ],
|
|
117
|
-
extends: [
|
|
118
|
-
"./rules/json/base.js",
|
|
119
|
-
],
|
|
128
|
+
extends: [ "./rules/json/base.js" ],
|
|
120
129
|
rules: {
|
|
121
130
|
"jsonc/sort-keys": [ "off" ],
|
|
122
131
|
},
|
|
123
132
|
},
|
|
124
133
|
{
|
|
125
134
|
files: [ "**.php" ],
|
|
126
|
-
plugins: [
|
|
127
|
-
"php-markup",
|
|
128
|
-
],
|
|
135
|
+
plugins: [ "php-markup" ],
|
|
129
136
|
globals: {
|
|
130
137
|
"lintPHPCode": true,
|
|
131
138
|
},
|
|
@@ -138,7 +145,7 @@ module.exports = {
|
|
|
138
145
|
"php/keep-eol": true,
|
|
139
146
|
"php/remove-whitespace": false,
|
|
140
147
|
"php/remove-empty-line": false,
|
|
141
|
-
"php/remove-php-lint":
|
|
148
|
+
"php/remove-php-lint": false,
|
|
142
149
|
},
|
|
143
150
|
},
|
|
144
151
|
{
|
|
@@ -152,21 +159,22 @@ module.exports = {
|
|
|
152
159
|
"*.e2e.*",
|
|
153
160
|
"*.e2e-spec.*",
|
|
154
161
|
],
|
|
155
|
-
extends: [
|
|
156
|
-
"./rules/typescript/tests.js",
|
|
157
|
-
],
|
|
162
|
+
extends: [ "./rules/typescript/tests.js" ],
|
|
158
163
|
},
|
|
159
164
|
{
|
|
160
165
|
files: [
|
|
166
|
+
".env.example",
|
|
161
167
|
".env.*",
|
|
162
168
|
"*.env",
|
|
169
|
+
".env.sample",
|
|
163
170
|
"*.properties",
|
|
164
171
|
"*.ini",
|
|
165
172
|
"*.toml",
|
|
166
173
|
],
|
|
167
|
-
|
|
168
|
-
"
|
|
174
|
+
plugins: [
|
|
175
|
+
"toml",
|
|
169
176
|
],
|
|
177
|
+
extends: [ "./rules/ini/base.js" ],
|
|
170
178
|
parser: "toml-eslint-parser",
|
|
171
179
|
},
|
|
172
180
|
{
|
|
@@ -174,12 +182,8 @@ module.exports = {
|
|
|
174
182
|
"*.yml",
|
|
175
183
|
"*.yaml",
|
|
176
184
|
],
|
|
177
|
-
plugins: [
|
|
178
|
-
|
|
179
|
-
],
|
|
180
|
-
extends: [
|
|
181
|
-
"./rules/yaml/base.js",
|
|
182
|
-
],
|
|
185
|
+
plugins: [ "yml" ],
|
|
186
|
+
extends: [ "./rules/yaml/base.js" ],
|
|
183
187
|
parser: "yaml-eslint-parser",
|
|
184
188
|
parserOptions: {
|
|
185
189
|
defaultYAMLVersion: "1.2",
|
|
@@ -190,9 +194,25 @@ module.exports = {
|
|
|
190
194
|
".github/**/*.yml",
|
|
191
195
|
".github/**/*.yaml",
|
|
192
196
|
],
|
|
193
|
-
extends: [
|
|
194
|
-
|
|
197
|
+
extends: [ "./rules/yaml/github.js" ],
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
files: [
|
|
201
|
+
".gitignore",
|
|
202
|
+
".npmignore",
|
|
203
|
+
"ignore",
|
|
204
|
+
".md",
|
|
205
|
+
".bash",
|
|
206
|
+
".sh",
|
|
207
|
+
".ps1",
|
|
208
|
+
".powershell",
|
|
209
|
+
".java",
|
|
210
|
+
".tf",
|
|
211
|
+
"Jenkinsfile",
|
|
212
|
+
"Dockerfile",
|
|
195
213
|
],
|
|
214
|
+
parser: "any-eslint-parser",
|
|
215
|
+
extends: [ "./rules/any/base.js" ],
|
|
196
216
|
},
|
|
197
217
|
],
|
|
198
218
|
rules: {},
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odg/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Linter for JavaScript And Typescript project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Dragons Gamers <https://www.linkedin.com/in/victor-alves-odgodinho>",
|
|
7
|
-
"scripts": {
|
|
7
|
+
"scripts": {
|
|
8
|
+
"lint": "eslint \"**/*.+(js|jsx|ts|tsx|json|jsonc|json5|yml|yaml|xml|txt|svg|properties|gradle|java|cpp|c|cs|html|css|groovy|gitignore|npmignore|toml|env|example|sample|ini|php|bat|powershell|ps1|sh|bash)\""
|
|
9
|
+
},
|
|
8
10
|
"repository": {
|
|
9
11
|
"type": "git",
|
|
10
12
|
"url": "git+https://github.com/ODGodinho/ODG-Linter-Js.git"
|
|
@@ -22,26 +24,29 @@
|
|
|
22
24
|
"@odg/tsconfig": "*",
|
|
23
25
|
"@typescript-eslint/eslint-plugin": "*",
|
|
24
26
|
"@typescript-eslint/parser": "*",
|
|
27
|
+
"any-eslint-parser": "^1.0.1",
|
|
25
28
|
"eslint": "*",
|
|
26
|
-
"eslint-plugin-anti-trojan-source": "
|
|
27
|
-
"eslint-plugin-array-func": "
|
|
28
|
-
"eslint-plugin-filenames": "
|
|
29
|
-
"eslint-plugin-html": "
|
|
30
|
-
"eslint-plugin-import": "
|
|
31
|
-
"eslint-plugin-jsdoc": "
|
|
32
|
-
"eslint-plugin-
|
|
33
|
-
"eslint-plugin-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"eslint-plugin-
|
|
39
|
-
"eslint-plugin-
|
|
40
|
-
"eslint-plugin-
|
|
41
|
-
"eslint-plugin-
|
|
42
|
-
"eslint-plugin-
|
|
43
|
-
"eslint-plugin-
|
|
44
|
-
"
|
|
29
|
+
"eslint-plugin-anti-trojan-source": "^1.1.0",
|
|
30
|
+
"eslint-plugin-array-func": "^3.1.7",
|
|
31
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
32
|
+
"eslint-plugin-html": "^7.1.0",
|
|
33
|
+
"eslint-plugin-import": "^2.26.0",
|
|
34
|
+
"eslint-plugin-jsdoc": "^39.6.4",
|
|
35
|
+
"eslint-plugin-json-schema-validator": "^4.0.3",
|
|
36
|
+
"eslint-plugin-jsonc": "^2.5.0",
|
|
37
|
+
"eslint-plugin-n": "^15.6.0",
|
|
38
|
+
"eslint-plugin-no-constructor-bind": "^2.0.4",
|
|
39
|
+
"eslint-plugin-php-markup": "^6.0.0",
|
|
40
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
41
|
+
"eslint-plugin-regex": "^1.10.0",
|
|
42
|
+
"eslint-plugin-regexp": "^1.11.0",
|
|
43
|
+
"eslint-plugin-security": "^1.5.0",
|
|
44
|
+
"eslint-plugin-sonar": "^0.10.0",
|
|
45
|
+
"eslint-plugin-sonarjs": "^0.17.0",
|
|
46
|
+
"eslint-plugin-toml": "^0.3.1",
|
|
47
|
+
"eslint-plugin-unicorn": "^45.0.2",
|
|
48
|
+
"eslint-plugin-yml": "^1.3.0",
|
|
49
|
+
"toml-eslint-parser": "^0.4.0"
|
|
45
50
|
},
|
|
46
51
|
"bugs": {
|
|
47
52
|
"url": "https://github.com/ODGodinho/ODG-Linter-Js/issues"
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const indentSize = 4;
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
"indent": [ "error", indentSize ], // 4 spaces
|
|
6
|
+
"quotes": [ "error", "double" ], // Aspas duplas
|
|
7
|
+
"capitalized-comments": [ "error" ], // Comentários devem ser iniciados em letras maiúsculas
|
|
8
|
+
"space-before-function-paren": [ "error", {
|
|
9
|
+
anonymous: "never",
|
|
10
|
+
named: "never",
|
|
11
|
+
asyncArrow: "always",
|
|
12
|
+
} ], // Não permite espaço antes dos parenteses
|
|
13
|
+
"dot-location": [ "error", "property" ], // Object.property ponto junto com a property
|
|
14
|
+
"no-extra-parens": [ "error" ], // Não permite parênteses extra
|
|
15
|
+
"no-extra-semi": [ "error" ], // Não permite ;, duplicadas ou desnecessárias
|
|
16
|
+
"linebreak-style": [ "error", "unix" ], // Força usar \n apenas em vez de \r\n
|
|
17
|
+
"max-len": [ "warn", {
|
|
18
|
+
code: 120,
|
|
19
|
+
ignoreUrls: true,
|
|
20
|
+
} ], // Caracteres máximo por linhas
|
|
21
|
+
"eol-last": [ "error", "always" ], // Força finalizar com \n no final
|
|
22
|
+
"array-bracket-spacing": [ "error", "always" ], // Força usar espaço entre chaves
|
|
23
|
+
"unicode-bom": [ "error", "never" ], // Disabled "unicode-bom"
|
|
24
|
+
"no-self-assign": [ "error" ], // Nao se atribua seu próprio valor a variável
|
|
25
|
+
"array-bracket-newline": [ "error", "consistent" ], // Quebra linha Array
|
|
26
|
+
"no-irregular-whitespace": [ "error" ], // Não permite espaços entre palavras
|
|
27
|
+
"no-floating-decimal": [ "error" ], // Não permite decimais flutuantes sem zero a esquerda.
|
|
28
|
+
"semi-spacing": [ "error", { before: false, after: true } ], // Não permite espaço antes do ;
|
|
29
|
+
"no-undef": [ "error", { "typeof": true } ], // Não chame variáveis não definidas
|
|
30
|
+
"regexp/negation": [ "error" ], // This rule enforces use of \D, \W, \S and \P on negation.
|
|
31
|
+
"regexp/confusing-quantifier": [ "error" ], // No Especifique quantidade em opcional
|
|
32
|
+
"regexp/control-character-escape": [ "error" ], // Use \r ao invés de \u0009
|
|
33
|
+
"regexp/no-dupe-characters-character-class": [ "error" ], // Rvita condições duplicada em []
|
|
34
|
+
"regexp/no-invisible-character": [ "error" ], // Evita colocar tab espaço em regex
|
|
35
|
+
"regexp/no-legacy-features": [ "error", {
|
|
36
|
+
staticProperties: [
|
|
37
|
+
"input",
|
|
38
|
+
"$_",
|
|
39
|
+
"lastMatch",
|
|
40
|
+
"$&",
|
|
41
|
+
"lastParen",
|
|
42
|
+
"$+",
|
|
43
|
+
"leftContext",
|
|
44
|
+
"$`",
|
|
45
|
+
"rightContext",
|
|
46
|
+
"$'",
|
|
47
|
+
"$1",
|
|
48
|
+
"$2",
|
|
49
|
+
"$3",
|
|
50
|
+
"$4",
|
|
51
|
+
"$5",
|
|
52
|
+
"$6",
|
|
53
|
+
"$7",
|
|
54
|
+
"$8",
|
|
55
|
+
"$9",
|
|
56
|
+
],
|
|
57
|
+
prototypeMethods: [ "compile" ],
|
|
58
|
+
} ],
|
|
59
|
+
"regexp/no-non-standard-flag": [ "error" ], // Bloqueia flags não padronizada
|
|
60
|
+
"regexp/no-obscure-range": [ "error" ], // Range regex /[A-\x43]/;
|
|
61
|
+
"regexp/no-trivially-nested-quantifier": [ "error" ], // Bloqueia flags não padronizada
|
|
62
|
+
"regexp/no-unused-capturing-group": [ "error" ], // Não crie grupos que não está sendo usado.
|
|
63
|
+
"regexp/no-useless-character-class": [ "error" ], // Não crie blocos desnecessários
|
|
64
|
+
"regexp/no-useless-flag": [ "error" ], // Não Use Flag desnecessários
|
|
65
|
+
"regexp/no-useless-lazy": [ "error" ],
|
|
66
|
+
"regexp/no-useless-quantifier": [ "error" ], // Não permite Quantifiers sem efeitos
|
|
67
|
+
"regexp/no-useless-range": [ "error" ], // Não permite Range desnecessários
|
|
68
|
+
"regexp/no-useless-two-nums-quantifier": [ "error" ], // Não permite Range Iguais
|
|
69
|
+
"regexp/no-zero-quantifier": [ "error" ], // Não permite Quantidade {0}
|
|
70
|
+
"regexp/optimal-lookaround-quantifier": [ "error" ],
|
|
71
|
+
"regexp/optimal-quantifier-concatenation": [ "error" ],
|
|
72
|
+
"regexp/prefer-quantifier": [ "error" ], // Use {4} ao invés de replicar
|
|
73
|
+
"regexp/prefer-range": [ "error" ], // Prefira [0-9] ao invés [1234567890]
|
|
74
|
+
"regexp/sort-alternatives": [ "error" ], // Coloque [a|b|c] ordem alfabética
|
|
75
|
+
"regexp/hexadecimal-escape": [ "error" ], // \x0a ao invés \u000a
|
|
76
|
+
"regexp/match-any": [ "error" ], // Não da match com qualquer coisa
|
|
77
|
+
"regexp/no-useless-escape": [ "error" ], // Não coloca \ contra em local sem efeito
|
|
78
|
+
"regexp/no-useless-non-capturing-group": [ "error" ], // Grupo não necessário
|
|
79
|
+
"regexp/prefer-character-class": [ "error" ], // Prefira [] ao invés de |
|
|
80
|
+
"regexp/prefer-d": [ "error" ], // Prefira \d
|
|
81
|
+
"regexp/prefer-plus-quantifier": [ "error" ], // Prefira + ao invés de {1, }
|
|
82
|
+
"regexp/prefer-question-quantifier": [ "error" ], // Prefira ? ao invés de {0,1}
|
|
83
|
+
"regexp/prefer-star-quantifier": [ "error" ], // Prefira * ao invés de {0,}
|
|
84
|
+
"regexp/prefer-unicode-codepoint-escapes": [ "error" ], // Use Unicode
|
|
85
|
+
"regexp/prefer-w": [ "error" ], // Use \w
|
|
86
|
+
"regexp/sort-character-class-elements": [ "error" ], // Coloque [] em ordem Alfabética
|
|
87
|
+
"regexp/sort-flags": [ "error" ], // Flag em ordem alfabética
|
|
88
|
+
"regexp/prefer-named-capture-group": [ "error" ], // Prefira group com nomes
|
|
89
|
+
// "regexp/prefer-regexp-exec": [ "error" ], // Prefira exec em regex // ? Desabilitado falso positivo
|
|
90
|
+
"unicorn/no-empty-file": [ "error" ], // Não crie arquivo vazio
|
|
91
|
+
"no-magic-numbers": [
|
|
92
|
+
"warn",
|
|
93
|
+
{ "ignore": [ 0, 1, -1 ], "enforceConst": true, "ignoreDefaultValues": true },
|
|
94
|
+
], // Não permite numero mágicos
|
|
95
|
+
"semi-style": [ "error", "last" ], // Local do ponto e virgula
|
|
96
|
+
"no-negated-condition": [ "error" ], // Não negue condições
|
|
97
|
+
"sonar/regex-complexity": [ "error" ], // Regex Complexidade
|
|
98
|
+
"sonarjs/no-identical-functions": [ "error" ], // Não faça funções iguais
|
|
99
|
+
"sonarjs/no-inverted-boolean-check": [ "error" ], // Não faça funções iguais
|
|
100
|
+
"sonarjs/no-nested-switch": [ "error" ], // Não faça switch dentro do outro
|
|
101
|
+
"sonarjs/no-nested-template-literals": [ "error" ], // Não faça string Template dentro de outra
|
|
102
|
+
"sonarjs/no-redundant-boolean": [ "error" ], // Não faça !false ou `boolReturnFunc() || false`
|
|
103
|
+
"sonarjs/prefer-immediate-return": [ "error" ], // Prefira retornar imediatamente a variável
|
|
104
|
+
"sonarjs/prefer-object-literal": [ "error" ], // Prefira declarar dentro do objeto inicial ao invés de injetar
|
|
105
|
+
"sonarjs/prefer-single-boolean-return": [ "error" ], // Retorne a boolean em vez de fazer if e else
|
|
106
|
+
"no-multiple-empty-lines": [
|
|
107
|
+
"error",
|
|
108
|
+
{ "max": 1, "maxEOF": 0, "maxBOF": 0 },
|
|
109
|
+
], // Não permita varias linhas em branco
|
|
110
|
+
},
|
|
111
|
+
};
|
|
File without changes
|
|
@@ -3,7 +3,6 @@ module.exports = {
|
|
|
3
3
|
"no-extra-bind": [ "error" ], // Não use bind desnecessário
|
|
4
4
|
"no-global-assign": [ "error" ], // Não atribua propriedade globais
|
|
5
5
|
"require-yield": [ "error" ], // Coloque yield em generator functions
|
|
6
|
-
"no-template-curly-in-string": [ "error" ], // Não faça templete string de forma incorreta
|
|
7
6
|
"no-dupe-else-if": [ "error" ], // Não permite elseif duplicado
|
|
8
7
|
"no-useless-backreference": [ "error" ], // Bloqueia regex com referencia inútil
|
|
9
8
|
"no-unused-private-class-members": [ "error" ], // Métodos privados não sendo usados
|
|
@@ -69,5 +68,6 @@ module.exports = {
|
|
|
69
68
|
"sonarjs/no-duplicated-branches": [ "error" ], // Em vez de if else igual faça um ||
|
|
70
69
|
"sonarjs/no-gratuitous-expressions": [ "error" ], // Não faça a mesma condição dentro de outra
|
|
71
70
|
"sonarjs/no-unused-collection": [ "error" ], // Não faça array que não é usado
|
|
71
|
+
"json-schema-validator/no-invalid": [ "warn" ], // Validação de schema
|
|
72
72
|
},
|
|
73
73
|
};
|
|
File without changes
|
package/rules/ini/base.js
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
rules: {
|
|
3
3
|
"filenames/match-regex": [ "off" ],
|
|
4
|
+
"max-len": [ "warn", {
|
|
5
|
+
code: 120,
|
|
6
|
+
ignoreUrls: true,
|
|
7
|
+
ignoreStrings: true,
|
|
8
|
+
ignoreTemplateLiterals: true,
|
|
9
|
+
} ], // Caracteres máximo por linhas
|
|
10
|
+
"toml/indent": [ "error" ], // Indent
|
|
11
|
+
"toml/keys-order": [ "error" ], // Indent
|
|
12
|
+
"toml/no-non-decimal-integer": [ "error" ], // No decimal int
|
|
13
|
+
"toml/no-space-dots": [ "error" ], // Não espace os pontos
|
|
14
|
+
"toml/no-unreadable-number-separator": [ "error" ], // Não faça números ilegíveis
|
|
15
|
+
"toml/padding-line-between-pairs": [ "error" ], // Não coloque espaço no mesmo bloco
|
|
16
|
+
"toml/padding-line-between-tables": [ "error" ], // Coloque espaço em []
|
|
17
|
+
"toml/precision-of-fractional-seconds": [ "error" ], // Não coloque grande precisão em segundos
|
|
18
|
+
"toml/precision-of-integer": [ "error" ], // Evite int gigantes
|
|
19
|
+
"toml/quoted-keys": [ "error" ], // Não Coloque aspas em key
|
|
20
|
+
"toml/tables-order": [ "error" ], // Ordene dentro de uma tabela
|
|
21
|
+
"toml/vue-custom-block/no-parsing-error": [ "error" ], // Valide toml em vue file
|
|
22
|
+
"toml/array-bracket-newline": [ "error" ], // Faça array em quebra de linhas
|
|
23
|
+
"toml/array-bracket-spacing": [ "error" ], // Espaço declarar array
|
|
24
|
+
"toml/array-element-newline": [ "error", "consistent" ], // Array multipla linhas
|
|
25
|
+
"toml/comma-style": [ "error" ], // Virgula a direita
|
|
26
|
+
"toml/spaced-comment": [ "error" ], // Espaço a esquerda comentário
|
|
27
|
+
"toml/inline-table-curly-spacing": [ "error", "always", {
|
|
28
|
+
arraysInObjects: true,
|
|
29
|
+
objectsInObjects: true,
|
|
30
|
+
} ], // Espaço em declarar {}
|
|
31
|
+
"toml/key-spacing": [ "error", {
|
|
32
|
+
beforeEqual: false,
|
|
33
|
+
afterEqual: false,
|
|
34
|
+
} ], // Sem espaço antes de depois do igual
|
|
4
35
|
},
|
|
5
36
|
};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
const indentSize = 4;
|
|
2
1
|
const alwaysMultiline = "always-multiline";
|
|
3
2
|
|
|
4
3
|
module.exports = {
|
|
5
4
|
rules: {
|
|
6
|
-
"indent": [ "error", indentSize ], // 4 spaces
|
|
7
5
|
"semi": [ "error", "always" ], // Força usar ponto-virgula ;
|
|
8
|
-
"quotes": [ "error", "double" ], // Aspas duplas
|
|
9
6
|
"lines-between-class-members": [ "error", "always" ], // Força linha em branco entre props classe e funções
|
|
10
|
-
"space-before-function-paren": [ "error", {
|
|
11
|
-
anonymous: "never",
|
|
12
|
-
named: "never",
|
|
13
|
-
asyncArrow: "always",
|
|
14
|
-
} ], // Não permite espaço antes dos parenteses
|
|
15
7
|
"no-unused-vars": [ "error", {
|
|
16
8
|
"vars": "all",
|
|
17
9
|
"args": "after-used",
|
|
@@ -37,9 +29,6 @@ module.exports = {
|
|
|
37
29
|
} ], // Virgula no final de tudo
|
|
38
30
|
"no-array-constructor": [ "error" ], // Não permite usar new Array()
|
|
39
31
|
"no-throw-literal": [ "error" ], // Não permite throw "string" ou diferente de classe
|
|
40
|
-
"dot-location": [ "error", "property" ], // Object.property ponto junto com a property
|
|
41
|
-
"no-extra-parens": [ "error" ], // Não permite parênteses extra
|
|
42
|
-
"no-extra-semi": [ "error" ], // Não permite ;, duplicadas ou desnecessárias
|
|
43
32
|
"no-empty-function": [ "error" ], // Não permite funções vazias
|
|
44
33
|
"no-duplicate-imports": [ "error" ], // Bloqueia import duplicado
|
|
45
34
|
"import/no-duplicates": [ "error" ], // Bloqueia import duplicado
|
|
@@ -49,12 +38,6 @@ module.exports = {
|
|
|
49
38
|
"error",
|
|
50
39
|
{ disallowArithmeticOperators: true },
|
|
51
40
|
], // Protege de optional que pode gerar errors
|
|
52
|
-
"linebreak-style": [ "error", "unix" ], // Força usar \n apenas em vez de \r\n
|
|
53
|
-
"eol-last": [ "error", "always" ], // Força finalizar com \n no final
|
|
54
|
-
"max-len": [ "warn", {
|
|
55
|
-
code: 120,
|
|
56
|
-
ignoreUrls: true,
|
|
57
|
-
} ], // Caracteres máximo por linhas
|
|
58
41
|
"camelcase": [ "error" ], // Força camelCase
|
|
59
42
|
"padded-blocks": [ "error", {
|
|
60
43
|
classes: "always",
|
|
@@ -62,7 +45,6 @@ module.exports = {
|
|
|
62
45
|
switches: "never",
|
|
63
46
|
} ], // Força não usar blocos com espaços
|
|
64
47
|
"no-multi-assign": [ "error" ], // Força não usar atribuição múltipla
|
|
65
|
-
"array-bracket-spacing": [ "error", "always" ], // Força usar espaço entre chaves
|
|
66
48
|
"keyword-spacing": [ "error", {
|
|
67
49
|
before: true,
|
|
68
50
|
after: true,
|
|
@@ -78,22 +60,17 @@ module.exports = {
|
|
|
78
60
|
},
|
|
79
61
|
},
|
|
80
62
|
],
|
|
81
|
-
"unicode-bom": [ "error", "never" ], // Disabled "unicode-bom"
|
|
82
63
|
"space-in-parens": [ "error", "never" ], // Não permite espaço entre parenteses
|
|
83
64
|
"no-multi-spaces": [ "error" ], // Nao permite vários espaços if( i )
|
|
84
65
|
"computed-property-spacing": [ "error", "never" ], // Desliga espaço ao recuperar item $a[ 'I' ] ou $a[ ] = 12;
|
|
85
|
-
"no-self-assign": [ "error" ], // Nao se atribua seu próprio valor a variável
|
|
86
|
-
"array-bracket-newline": [ "error", "consistent" ], // Quebra linha Array
|
|
87
66
|
"prefer-arrow-callback": [ "error" ], // Força arrow function
|
|
88
67
|
"arrow-body-style": [ "error", "as-needed" ], // Força arrow function sem body
|
|
89
68
|
"no-empty": [ "error" ], // Não permite blocos vazios (if, while, for, function, etc)
|
|
90
|
-
|
|
91
69
|
"newline-before-return": [ "error" ], // Força retorno de função com \n antes
|
|
92
70
|
"multiline-comment-style": [ "error", "starred-block" ], // Força /* comentário */ ao invés de // varias vezes
|
|
93
71
|
"no-unreachable": [ "error" ], // Não permite unreachable code
|
|
94
72
|
"no-multi-str": [ "error" ], // Não quebre linha dentro de uma string
|
|
95
73
|
"consistent-this": [ "error", "that" ], // Não permite this em locais inconsistente.
|
|
96
|
-
"no-irregular-whitespace": [ "error" ], // Não permite espaços entre palavras
|
|
97
74
|
"dot-notation": [ "error" ], // Força usar dot em objeto em vez de object["key"]
|
|
98
75
|
"no-whitespace-before-property": [ "error" ], // Não permite espaço antes de property
|
|
99
76
|
"no-trailing-spaces": [ "error" ], // Não permite espaço apos ou antes do ponto
|
|
@@ -116,7 +93,6 @@ module.exports = {
|
|
|
116
93
|
"eqeqeq": [ "error", "always" ], // Usa igual e do mesmo tipo
|
|
117
94
|
"no-extra-label": [ "error" ], // Não permite usar labels extra desnecessárias
|
|
118
95
|
"no-labels": [ "error" ], // Disable Label/GOTO
|
|
119
|
-
"no-floating-decimal": [ "error" ], // Não permite decimais flutuantes sem zero a esquerda.
|
|
120
96
|
"no-native-reassign": [ "error" ], // Não permite reatribuição de funções/vars nativas
|
|
121
97
|
"no-new": [ "error" ], // Não permite usar new sem salva-lo
|
|
122
98
|
"no-new-func": [ "error" ], // Não permite usar new Function()
|
|
@@ -128,13 +104,8 @@ module.exports = {
|
|
|
128
104
|
"no-new-require": [ "error" ], // Não permite usar new require()
|
|
129
105
|
"no-new-object": [ "error" ], // Não permite usar new Object
|
|
130
106
|
"prefer-template": [ "error" ], // Prefer template literals over string concatenation
|
|
131
|
-
"no-multiple-empty-lines": [
|
|
132
|
-
"error",
|
|
133
|
-
{ "max": 1, "maxEOF": 0, "maxBOF": 0 },
|
|
134
|
-
], // Não permita varias linhas em branco
|
|
135
107
|
"no-async-promise-executor": [ "error" ], // Não permita use função async para executar promise
|
|
136
108
|
"prefer-promise-reject-errors": [ "error" ], // Passe uma Exception em promise ao invés de string/number
|
|
137
|
-
"semi-spacing": [ "error", { before: false, after: true } ], // Não permite espaço antes do ;
|
|
138
109
|
"no-var": [ "error" ], // Não user var prefira let ou const
|
|
139
110
|
"promise/no-new-statics": [ "error" ], // Não permite usar new em static promise
|
|
140
111
|
"promise/no-return-wrap": [ "error" ], // Não use promise.resolve ou reject dentro de then e catch
|
|
@@ -160,7 +131,6 @@ module.exports = {
|
|
|
160
131
|
"new-cap": [ "error", { newIsCap: true } ], // New require first Letter uppercase
|
|
161
132
|
"no-caller": [ "error" ], // Não permite usar callee
|
|
162
133
|
"no-script-url": [ "error" ], // Não permite usar script url
|
|
163
|
-
"no-undef": [ "error", { "typeof": true } ], // Não chame variáveis não definidas
|
|
164
134
|
"func-names": [ "error", "as-needed" ], // Nome de funções somente quando necessário
|
|
165
135
|
"no-param-reassign": [ "error" ], // Não permite reatribuição de parâmetros
|
|
166
136
|
"quote-props": [ "error", "consistent" ], // Aspas no objeto somente se algum for necessário
|
|
@@ -177,66 +147,6 @@ module.exports = {
|
|
|
177
147
|
"object-property-newline": [ "error", {
|
|
178
148
|
allowAllPropertiesOnSameLine: true,
|
|
179
149
|
} ], // Quebre todos objetos ou nenhum
|
|
180
|
-
"regexp/confusing-quantifier": [ "error" ], // No Especifique quantidade em opcional
|
|
181
|
-
"regexp/control-character-escape": [ "error" ], // Use \r ao invés de \u0009
|
|
182
|
-
"regexp/negation": [ "error" ], // This rule enforces use of \D, \W, \S and \P on negation.
|
|
183
|
-
"regexp/no-dupe-characters-character-class": [ "error" ], // Rvita condições duplicada em []
|
|
184
|
-
"regexp/no-invisible-character": [ "error" ], // Evita colocar tab espaço em regex
|
|
185
|
-
"regexp/no-legacy-features": [ "error", {
|
|
186
|
-
staticProperties: [
|
|
187
|
-
"input",
|
|
188
|
-
"$_",
|
|
189
|
-
"lastMatch",
|
|
190
|
-
"$&",
|
|
191
|
-
"lastParen",
|
|
192
|
-
"$+",
|
|
193
|
-
"leftContext",
|
|
194
|
-
"$`",
|
|
195
|
-
"rightContext",
|
|
196
|
-
"$'",
|
|
197
|
-
"$1",
|
|
198
|
-
"$2",
|
|
199
|
-
"$3",
|
|
200
|
-
"$4",
|
|
201
|
-
"$5",
|
|
202
|
-
"$6",
|
|
203
|
-
"$7",
|
|
204
|
-
"$8",
|
|
205
|
-
"$9",
|
|
206
|
-
],
|
|
207
|
-
prototypeMethods: [ "compile" ],
|
|
208
|
-
} ],
|
|
209
|
-
"regexp/no-non-standard-flag": [ "error" ], // Bloqueia flags não padronizada
|
|
210
|
-
"regexp/no-obscure-range": [ "error" ], // Range regex /[A-\x43]/;
|
|
211
|
-
"regexp/no-trivially-nested-quantifier": [ "error" ], // Bloqueia flags não padronizada
|
|
212
|
-
"regexp/no-unused-capturing-group": [ "error" ], // Não crie grupos que não está sendo usado.
|
|
213
|
-
"regexp/no-useless-character-class": [ "error" ], // Não crie blocos desnecessários
|
|
214
|
-
"regexp/no-useless-flag": [ "error" ], // Não Use Flag desnecessários
|
|
215
|
-
"regexp/no-useless-lazy": [ "error" ],
|
|
216
|
-
"regexp/no-useless-quantifier": [ "error" ], // Não permite Quantifiers sem efeitos
|
|
217
|
-
"regexp/no-useless-range": [ "error" ], // Não permite Range desnecessários
|
|
218
|
-
"regexp/no-useless-two-nums-quantifier": [ "error" ], // Não permite Range Iguais
|
|
219
|
-
"regexp/no-zero-quantifier": [ "error" ], // Não permite Quantidade {0}
|
|
220
|
-
"regexp/optimal-lookaround-quantifier": [ "error" ],
|
|
221
|
-
"regexp/optimal-quantifier-concatenation": [ "error" ],
|
|
222
|
-
"regexp/prefer-quantifier": [ "error" ], // Use {4} ao invés de replicar
|
|
223
|
-
"regexp/prefer-range": [ "error" ], // Prefira [0-9] ao invés [1234567890]
|
|
224
|
-
"regexp/sort-alternatives": [ "error" ], // Coloque [a|b|c] ordem alfabética
|
|
225
|
-
"regexp/hexadecimal-escape": [ "error" ], // \x0a ao invés \u000a
|
|
226
|
-
"regexp/match-any": [ "error" ], // Não da match com qualquer coisa
|
|
227
|
-
"regexp/no-useless-escape": [ "error" ], // Não coloca \ contra em local sem efeito
|
|
228
|
-
"regexp/no-useless-non-capturing-group": [ "error" ], // Grupo não necessário
|
|
229
|
-
"regexp/prefer-character-class": [ "error" ], // Prefira [] ao invés de |
|
|
230
|
-
"regexp/prefer-d": [ "error" ], // Prefira \d
|
|
231
|
-
"regexp/prefer-plus-quantifier": [ "error" ], // Prefira + ao invés de {1, }
|
|
232
|
-
"regexp/prefer-question-quantifier": [ "error" ], // Prefira ? ao invés de {0,1}
|
|
233
|
-
"regexp/prefer-star-quantifier": [ "error" ], // Prefira * ao invés de {0,}
|
|
234
|
-
"regexp/prefer-unicode-codepoint-escapes": [ "error" ], // Use Unicode
|
|
235
|
-
"regexp/prefer-w": [ "error" ], // Use \w
|
|
236
|
-
"regexp/sort-character-class-elements": [ "error" ], // Coloque [] em ordem Alfabética
|
|
237
|
-
"regexp/sort-flags": [ "error" ], // Flag em ordem alfabética
|
|
238
|
-
"regexp/prefer-named-capture-group": [ "error" ], // Prefira group com nomes
|
|
239
|
-
// "regexp/prefer-regexp-exec": [ "error" ], // Prefira exec em regex // ? Desabilitado falso positivo
|
|
240
150
|
"max-statements-per-line": [ "error", { "max": 1 } ], // Máximo operação em 1 linha
|
|
241
151
|
"arrow-parens": [ "error", "always" ], // Arrow Function sempre com parentese
|
|
242
152
|
"padding-line-between-statements": [
|
|
@@ -277,7 +187,6 @@ module.exports = {
|
|
|
277
187
|
"unicorn/no-array-method-this-argument": [ "error" ], // Evita this array que pode falhar
|
|
278
188
|
"unicorn/no-array-push-push": [ "error" ], // Faça apenas 1 push ao invés de vários
|
|
279
189
|
"unicorn/no-await-expression-member": [ "error" ], // Não use (await getObject()).property;
|
|
280
|
-
"unicorn/no-empty-file": [ "error" ], // Não crie arquivo vazio
|
|
281
190
|
"unicorn/no-for-loop": [ "error" ], // Use ForOf em vez de for
|
|
282
191
|
"unicorn/no-invalid-remove-event-listener": [ "error" ], // Não use removeEventListener Invalid
|
|
283
192
|
"no-lonely-if": [ "error" ], // Não faz if cadeia desnecessário
|
|
@@ -323,14 +232,16 @@ module.exports = {
|
|
|
323
232
|
"unicorn/template-indent": [ "error" ], // Indenter em template string
|
|
324
233
|
"unicorn/no-nested-ternary": [ "error" ], // Ternário ilegível
|
|
325
234
|
"no-shadow": [ "error" ], // Erro caso ja esteja declarado escopo a cima
|
|
326
|
-
"sonar/no-globals-shadowing": [ "error" ], // Não declare palavras reservadas
|
|
327
235
|
"no-delete-var": [ "error" ], // Não delete variáveis
|
|
328
236
|
"no-lone-blocks": [ "error" ], // Não crie bloco desnecessários
|
|
329
237
|
"no-proto": [ "error" ], // Não use __proto__ depreciada desde ECMA 3.1
|
|
330
238
|
"id-length": [ "error", {
|
|
331
239
|
"min": 3,
|
|
332
240
|
"exceptions": [ "i", "fs", "os", "id", "ip" ],
|
|
241
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
242
|
+
"exceptionPatterns": [ "^\\${1,2}[a-z]?$" ],
|
|
333
243
|
} ], // Tamanho mínimo das variáveis
|
|
244
|
+
"no-template-curly-in-string": [ "error" ], // Não faça templete string de forma incorreta
|
|
334
245
|
"max-depth": [ "error", { "max": 3 } ], // Tamanho máximo do Hadouken
|
|
335
246
|
"max-params": [ "error", { "max": 4 } ], // Máximo de parâmetros
|
|
336
247
|
"max-statements": [ "error" ], // Máximo atribuição em função
|
|
@@ -348,10 +259,6 @@ module.exports = {
|
|
|
348
259
|
"no-promise-executor-return": [ "error" ], // Não coloque um retorno em new Promise()
|
|
349
260
|
"no-nonoctal-decimal-escape": [ "error" ], // Não coloque scape em numero decimais
|
|
350
261
|
"prefer-destructuring": [ "error" ], // Prefira desestruturar array ao invés
|
|
351
|
-
"no-magic-numbers": [
|
|
352
|
-
"warn",
|
|
353
|
-
{ "ignore": [ 0, 1, -1 ], "enforceConst": true, "ignoreDefaultValues": true },
|
|
354
|
-
], // Não permite numero mágicos
|
|
355
262
|
"complexity": [ "error", { "max": 10 } ], // Complexidade código
|
|
356
263
|
"func-style": [ "error", "declaration" ], // Declare function name() em vez de var = function()
|
|
357
264
|
"no-else-return": [ "error" ], // Não use else se tem retorno
|
|
@@ -485,7 +392,6 @@ module.exports = {
|
|
|
485
392
|
"no-shadow-restricted-names": [ "error" ], // Sem variável com palavra reservada
|
|
486
393
|
"logical-assignment-operators": [ "error", "always" ], // Faça ||= ao invés a = a || b
|
|
487
394
|
"no-with": [ "error" ], // Não use with
|
|
488
|
-
"semi-style": [ "error", "last" ], // Local do ponto e virgula
|
|
489
395
|
"object-curly-newline": [
|
|
490
396
|
"error",
|
|
491
397
|
{
|
|
@@ -511,7 +417,6 @@ module.exports = {
|
|
|
511
417
|
},
|
|
512
418
|
},
|
|
513
419
|
],
|
|
514
|
-
"no-negated-condition": [ "error" ], // Local do ponto e virgula
|
|
515
420
|
"no-mixed-spaces-and-tabs": [ "error" ],
|
|
516
421
|
"func-name-matching": [
|
|
517
422
|
"error",
|
|
@@ -535,16 +440,8 @@ module.exports = {
|
|
|
535
440
|
"sonar/no-redundant-optional": [ "error" ], // Não use ? e undefined
|
|
536
441
|
"sonar/prefer-type-guard": [ "error" ], // Força retorna is boolean
|
|
537
442
|
"sonar/production-debug": [ "error" ], // Não use debug em prod
|
|
538
|
-
"sonar/regex-complexity": [ "error" ], // Regex Complexidade
|
|
539
443
|
"sonar/shorthand-property-grouping": [ "error" ], // Agrupe { a, b, c:1, d:2}
|
|
540
444
|
"sonar/unused-named-groups": [ "error" ], // Grupos não usados de regex
|
|
541
|
-
|
|
542
|
-
"sonarjs/no-inverted-boolean-check": [ "error" ], // Não faça funções iguais
|
|
543
|
-
"sonarjs/no-nested-switch": [ "error" ], // Não faça switch dentro do outro
|
|
544
|
-
"sonarjs/no-nested-template-literals": [ "error" ], // Não faça string Template dentro de outra
|
|
545
|
-
"sonarjs/no-redundant-boolean": [ "error" ], // Não faça !false ou `boolReturnFunc() || false`
|
|
546
|
-
"sonarjs/prefer-immediate-return": [ "error" ], // Prefira retornar imediatamente a variável
|
|
547
|
-
"sonarjs/prefer-object-literal": [ "error" ], // Prefira declarar dentro do objeto inicial ao invés de injetar
|
|
548
|
-
"sonarjs/prefer-single-boolean-return": [ "error" ], // Retorne a boolean em vez de fazer if e else
|
|
445
|
+
|
|
549
446
|
},
|
|
550
447
|
};
|
|
@@ -3,7 +3,6 @@ module.exports = {
|
|
|
3
3
|
"spaced-comment": [ "error", "always", {
|
|
4
4
|
exceptions: [ "-", "+" ],
|
|
5
5
|
} ], // Força espaço apos do // comentário
|
|
6
|
-
"capitalized-comments": [ "error" ], // Comentários devem ser iniciados em letras maiúsculas
|
|
7
6
|
"jsdoc/check-access": [ "error" ],
|
|
8
7
|
"jsdoc/check-alignment": [ "error" ], // Não desalinhe o * da docblock
|
|
9
8
|
"jsdoc/check-indentation": [ "error" ], // Força formatação na docblock
|
package/rules/json/base.js
CHANGED
|
@@ -15,5 +15,11 @@ module.exports = {
|
|
|
15
15
|
"error",
|
|
16
16
|
{ "consistent": true },
|
|
17
17
|
], // Força quebrar linha em todos #4 os itens objeto
|
|
18
|
+
"max-len": [ "warn", {
|
|
19
|
+
code: 120,
|
|
20
|
+
ignoreUrls: true,
|
|
21
|
+
ignoreStrings: true,
|
|
22
|
+
ignoreTemplateLiterals: true,
|
|
23
|
+
} ], // Caracteres máximo por linhas
|
|
18
24
|
},
|
|
19
25
|
};
|
|
@@ -104,8 +104,8 @@ module.exports = {
|
|
|
104
104
|
fixWith: "symbol",
|
|
105
105
|
},
|
|
106
106
|
"{}": {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
message: "The `{}` type is mostly the same as `unknown`. "
|
|
108
|
+
+ "You probably want `Record<string, unknown>` instead.",
|
|
109
109
|
fixWith: recordObject,
|
|
110
110
|
},
|
|
111
111
|
"object": {
|
|
@@ -8,5 +8,8 @@ module.exports = {
|
|
|
8
8
|
"max-statements": [ "error", MAX_STATEMENTS ],
|
|
9
9
|
"sonar/no-code-after-done": [ "error" ], // Não coloque código depois done test
|
|
10
10
|
"sonar/test-check-exception": [ "error" ], // Test exception
|
|
11
|
+
"unicorn/consistent-function-scoping": [ "error", {
|
|
12
|
+
checkArrowFunctions: false,
|
|
13
|
+
} ], // Remova sub função quando possível
|
|
11
14
|
},
|
|
12
15
|
};
|
package/rules/yaml/base.js
CHANGED
|
@@ -20,5 +20,11 @@ module.exports = {
|
|
|
20
20
|
"spaced-comment": [ "off" ], // Desliga regra JS
|
|
21
21
|
"yml/spaced-comment": [ "error" ], // Comentarios com espaço
|
|
22
22
|
"filenames/match-regex": [ "off" ], // Desliga validação de nomes
|
|
23
|
+
"max-len": [ "warn", {
|
|
24
|
+
code: 120,
|
|
25
|
+
ignoreUrls: true,
|
|
26
|
+
ignoreStrings: true,
|
|
27
|
+
ignoreTemplateLiterals: true,
|
|
28
|
+
} ], // Caracteres máximo por linhas
|
|
23
29
|
},
|
|
24
30
|
};
|