You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rules/ban_types.rs
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ enum BannedType {
20
20
Function,
21
21
CapitalObject,
22
22
LowerObject,
23
+
EmptyObjectLiteral,
23
24
}
24
25
25
26
implBannedType{
@@ -30,6 +31,7 @@ impl BannedType {
30
31
Function => "This provides no type safety because it represents all functions and classes",
31
32
CapitalObject => "This type may be different from what you expect it to be",
32
33
LowerObject => "This type is tricky to use so should be avoided if possible",
34
+
EmptyObjectLiteral => "`{}` doesn't mean an empty object, but means any types other than `null` and `undefined`",
33
35
}
34
36
}
35
37
@@ -45,6 +47,9 @@ impl BannedType {
45
47
r#"If you want a type meaning "any object", use `Record<string, unknown>` instead. Or if you want a type meaning "any value", you probably want `unknown` instead."#
0 commit comments