UNPKG

pi-lens

Version:

Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo

34 lines (33 loc) • 709 B
id: no-runtime-typeof valid: - | function isFoo(x: unknown): x is Foo { return typeof x === "object"; } - | const isBar = (x: unknown): x is Bar => typeof x === "object"; - | function parseThing(x: unknown) { return typeof x === "string"; } - | const validateThing = (x: unknown) => typeof x === "string"; - | class C { isFoo(x: unknown): x is Foo { return typeof x === "object"; } } invalid: - | function plain(x: unknown) { return typeof x === "string"; } - | const check = (x: unknown) => typeof x === "string"; - | class C { plain(x: unknown) { return typeof x === "string"; } }