@odg/eslint-config 3.0.0 → 3.0.2
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 +6 -1
- package/index.mjs +3 -0
- package/package.json +1 -1
- package/rules/global/base.mjs +1 -1
- package/rules/typescript/tests.mjs +2 -0
package/README.md
CHANGED
|
@@ -549,7 +549,9 @@ npm install @odg/eslint-config
|
|
|
549
549
|
yarn add -D @odg/eslint-config
|
|
550
550
|
```
|
|
551
551
|
|
|
552
|
-
Create the `eslint.config.
|
|
552
|
+
Create the `eslint.config.mjs` file in the root directory of your project.
|
|
553
|
+
|
|
554
|
+
> Use .mjs file to avoid warn errors
|
|
553
555
|
|
|
554
556
|
```js
|
|
555
557
|
import odgLinter from "@odg/eslint-config";
|
|
@@ -567,6 +569,9 @@ Add script in your `package.json` file
|
|
|
567
569
|
"scripts": {
|
|
568
570
|
"lint": "eslint",
|
|
569
571
|
"lint:fix": "eslint --fix",
|
|
572
|
+
},
|
|
573
|
+
"engines": {
|
|
574
|
+
"node": ">=24"
|
|
570
575
|
}
|
|
571
576
|
}
|
|
572
577
|
```
|
package/index.mjs
CHANGED
package/package.json
CHANGED
package/rules/global/base.mjs
CHANGED
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
"regexp/sort-character-class-elements": [ "error" ], // Coloque [] em ordem Alfabética
|
|
84
84
|
"regexp/sort-flags": [ "error" ], // Flag em ordem alfabética
|
|
85
85
|
"regexp/prefer-named-capture-group": [ "error" ], // Prefira group com nomes
|
|
86
|
-
"regexp/prefer-regexp-exec": [ "error" ], // Prefira exec em regex
|
|
86
|
+
// "regexp/prefer-regexp-exec": [ "error" ], // Prefira exec em regex // Match retorna 1 resultado apenas
|
|
87
87
|
|
|
88
88
|
"unicorn/no-empty-file": [ "error" ], // Não crie arquivo vazio
|
|
89
89
|
"no-magic-numbers": [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const MAX_STATEMENTS = 20;
|
|
2
|
+
const maxHadoukenDepth = 5;
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
rules: {
|
|
@@ -7,6 +8,7 @@ export default {
|
|
|
7
8
|
"no-magic-numbers": [ "off" ], // Desliga magic number em test
|
|
8
9
|
"@typescript-eslint/no-magic-numbers": [ "off" ], // Desliga magic number em test
|
|
9
10
|
"max-statements": [ "error", MAX_STATEMENTS ],
|
|
11
|
+
"max-nested-callbacks": [ "error", maxHadoukenDepth ], // Tamanho máximo do Hadouken callback
|
|
10
12
|
"unicorn/consistent-function-scoping": [
|
|
11
13
|
"error",
|
|
12
14
|
{
|