Skip to content

Commit 5f9d6fe

Browse files
committed
fix: Update eslint rule severity and modify todo comments
Signed-off-by: prisis <[email protected]>
1 parent bcf423f commit 5f9d6fe

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

Diff for: packages/eslint-config/src/config/plugins/typescript.ts

-17
Original file line numberDiff line numberDiff line change
@@ -257,23 +257,6 @@ const config: Linter.Config = createConfigs([
257257
Number: { message: "Use number instead", fixWith: "number" },
258258
Object: { message: "Use object instead", fixWith: "object" },
259259
Array: { message: "Provide a more specific type" },
260-
// Ban the type-unsafe built-in utility types because they're vulnerable to typos and to failing silently after a rename refactoring.
261-
// See https://www.typescriptlang.org/docs/handbook/utility-types.html
262-
// See https://github.com/pelotom/type-zoo#omitstrictt-k-extends-keyof-t
263-
// See https://github.com/krzkaczor/ts-essentials#Comparison-between-Omit-and-StrictOmit
264-
// TODO make this a real rule instead of using `ban-types`: https://github.com/danielnixon/eslint-plugin-total-functions/issues/88
265-
Omit: {
266-
fixWith: "OmitStrict",
267-
message: "Omit is not type-safe. Prefer a strict version such as OmitStrict from the type-zoo package.",
268-
},
269-
Exclude: {
270-
fixWith: "ExcludeStrict",
271-
message: "Exclude is not type-safe. Prefer a strict version such as ExcludeStrict from the type-zoo package.",
272-
},
273-
Extract: {
274-
fixWith: "ExtractStrict",
275-
message: "Extract is not type-safe. Prefer a strict version such as ExtractStrict from the type-zoo package.",
276-
},
277260
},
278261
},
279262
],

Diff for: packages/eslint-config/src/config/plugins/unicorn.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ const config: Linter.Config = {
5050
"error",
5151
{
5252
case: "kebabCase",
53-
ignore: [/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/],
53+
ignore: [/(FUNDING\.yml|README\.md|CHANGELOG\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|SECURITY\.md|LICENSE)/u],
5454
},
5555
],
5656

5757
"unicorn/no-array-for-each": "off",
5858

59-
// TODO: Disabled for now as I don't have time to deal with the backslash that might come from this. Try to enable this rule in 2021.
59+
// TODO: Disabled for now as I don't have time to deal with the backslash that might come from this. Try to enable this rule in 2024.
6060
"unicorn/no-null": "off",
6161

6262
// TODO: Temporarily disabled until it becomes more mature.

Diff for: packages/eslint-config/src/typescript-type-checking.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const config = createConfig("typescript", {
113113

114114
// Warns if a type assertion does not change the type of an expression
115115
// See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md
116-
"@typescript-eslint/non-nullable-type-assertion-style": "error",
116+
"@typescript-eslint/non-nullable-type-assertion-style": "off",
117117

118118
// See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/method-signature-style.md
119119
"@typescript-eslint/method-signature-style": "error",
@@ -175,15 +175,17 @@ const config = createConfig("typescript", {
175175
// Enforces unbound methods are called with their expected scope
176176
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: false }],
177177

178+
// TODO: enable this rule when decision is made on
178179
"@typescript-eslint/consistent-type-assertions": [
179-
"error",
180+
"off",
180181
{
181182
assertionStyle: "never",
182183
},
183184
],
184185

186+
// TODO: enable this rule when decision is made on
185187
"@typescript-eslint/strict-boolean-expressions": [
186-
"error",
188+
"off",
187189
{
188190
allowString: false,
189191
allowNumber: false,
@@ -192,7 +194,7 @@ const config = createConfig("typescript", {
192194
],
193195

194196
// Interfaces encourage OO, types encourage FP.
195-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
197+
"@typescript-eslint/consistent-type-definitions": "off",
196198
},
197199
});
198200

0 commit comments

Comments
 (0)