eslint-plugin-no-instanceof
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

eslint-plugin-no-instanceof

Disallows use of instanceof operator, useful in TS envs where code relies purely on structural typing (i.e. static typing based on presence of attributes)

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-no-instanceof:

$ npm install eslint-plugin-no-instanceof --save-dev

Usage

Add no-instanceof to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "no-instanceof"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "no-instanceof/no-instanceof": 2
    }
}

Supported Rules

  • no-instanceof

Package Sidebar

Install

npm i eslint-plugin-no-instanceof

Weekly Downloads

8,704

Version

1.0.1

License

ISC

Unpacked Size

3.27 kB

Total Files

8

Last publish

Collaborators

  • konyferous