Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 566 Bytes

File metadata and controls

20 lines (14 loc) · 566 Bytes

Disallow using typeof to check for value types

Rule details

This rule warns when code uses the typeof operator to check the type of a value. In roblox-ts, the typeof operator is not available, and you should use typeIs(value, type) or typeOf(value) instead for type checks.

Examples

const t = typeof a; // ❌
const t = typeOf(a); // ✅
if (typeof x === "string") {} // ❌
if (typeIs(x, "string")) {} // ✅