eslint-plugin

@masknet/type/no-instanceof-wrapper

Disallow instanceof for wrapper objects

Rule Details

:x: Incorrect

x instanceof Array
x instanceof BigInt
x instanceof Boolean
x instanceof Function
x instanceof Number
x instanceof Object
x instanceof String
x instanceof Symbol

:white_check_mark: Correct

Array.isArray(x)
typeof x === 'bigint'
typeof x === 'boolean'
typeof x === 'function'
typeof x === 'number'
typeof x === 'object'
typeof x === 'string'
typeof x === 'symbol'

Attributes

Thanks