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
I had code that relied on the empty object having no keys. Accepting the linter suggestion broke this.
typeX={}// `{}` doesn't mean an empty object, but means any types other than `null` and `undefined`// If you want a type that means "empty object", use `Record<string | number | symbol, never>` instead// deno-lint(ban-types)typeY=keyofX// nevertypeX2=Record<string|number|symbol,never>typeY2=keyofX2// string | number | symboltypeX3=Record<never,never>typeY3=keyofX3// never
Should the message change if the empty record is a generic bound?
The text was updated successfully, but these errors were encountered:
lucasavila00
changed the title
ban-types gives misleading/wrong suggestion
ban-types gives misleading/wrong suggestion for empty object on generic bounds
Mar 9, 2024
I had code that relied on the empty object having no keys. Accepting the linter suggestion broke this.
I ended up using Record<never, never>.
In my case, I was using this as a generic bound
Should the message change if the empty record is a generic bound?
The text was updated successfully, but these errors were encountered: