@odg/eslint-config 1.5.0 → 1.5.1
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/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const indentSize = 4;
|
|
2
|
+
const alwaysMultiline = "always-multiline";
|
|
2
3
|
|
|
3
4
|
module.exports = {
|
|
4
5
|
rules: {
|
|
@@ -28,11 +29,11 @@ module.exports = {
|
|
|
28
29
|
},
|
|
29
30
|
],
|
|
30
31
|
"comma-dangle": [ "error", {
|
|
31
|
-
arrays:
|
|
32
|
-
objects:
|
|
33
|
-
imports:
|
|
34
|
-
exports:
|
|
35
|
-
functions:
|
|
32
|
+
arrays: alwaysMultiline,
|
|
33
|
+
objects: alwaysMultiline,
|
|
34
|
+
imports: alwaysMultiline,
|
|
35
|
+
exports: alwaysMultiline,
|
|
36
|
+
functions: alwaysMultiline,
|
|
36
37
|
} ], // Virgula no final de tudo
|
|
37
38
|
"no-array-constructor": [ "error" ], // Não permite usar new Array()
|
|
38
39
|
"no-throw-literal": [ "error" ], // Não permite throw "string" ou diferente de classe
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const indentSize = 4;
|
|
2
|
+
const alwaysMultiline = "always-multiline";
|
|
3
|
+
const recordObject = "Record<string, unknown>";
|
|
2
4
|
|
|
3
5
|
module.exports = {
|
|
4
6
|
rules: {
|
|
@@ -38,14 +40,14 @@ module.exports = {
|
|
|
38
40
|
], // Espaço apos a virgula
|
|
39
41
|
"comma-dangle": [ "off" ],
|
|
40
42
|
"@typescript-eslint/comma-dangle": [ "error", {
|
|
41
|
-
arrays:
|
|
42
|
-
objects:
|
|
43
|
-
imports:
|
|
44
|
-
exports:
|
|
45
|
-
functions:
|
|
46
|
-
enums:
|
|
47
|
-
generics:
|
|
48
|
-
tuples:
|
|
43
|
+
arrays: alwaysMultiline,
|
|
44
|
+
objects: alwaysMultiline,
|
|
45
|
+
imports: alwaysMultiline,
|
|
46
|
+
exports: alwaysMultiline,
|
|
47
|
+
functions: alwaysMultiline,
|
|
48
|
+
enums: alwaysMultiline,
|
|
49
|
+
generics: alwaysMultiline,
|
|
50
|
+
tuples: alwaysMultiline,
|
|
49
51
|
} ], // Virgula no final de tudo
|
|
50
52
|
"no-array-constructor": [ "off" ], // Não permite usar new Array()
|
|
51
53
|
"@typescript-eslint/no-array-constructor": [ "error" ], // Não permite usar new Array()
|
|
@@ -85,7 +87,7 @@ module.exports = {
|
|
|
85
87
|
},
|
|
86
88
|
"Object": {
|
|
87
89
|
message: "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
88
|
-
fixWith:
|
|
90
|
+
fixWith: recordObject,
|
|
89
91
|
},
|
|
90
92
|
"String": {
|
|
91
93
|
message: "Use `string` instead.",
|
|
@@ -98,11 +100,11 @@ module.exports = {
|
|
|
98
100
|
"{}": {
|
|
99
101
|
// eslint-disable-next-line max-len
|
|
100
102
|
message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
|
|
101
|
-
fixWith:
|
|
103
|
+
fixWith: recordObject,
|
|
102
104
|
},
|
|
103
105
|
"object": {
|
|
104
106
|
message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
105
|
-
fixWith:
|
|
107
|
+
fixWith: recordObject,
|
|
106
108
|
},
|
|
107
109
|
"Function": "Use a specific function type instead, like `() => void`.",
|
|
108
110
|
"[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|