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)
npm install eslint-plugin-no-instanceofDisallows use of instanceof operator, useful in TS envs where code relies purely on structural typing (i.e. static typing based on presence of attributes)
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
Add no-instanceof to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
`json`
{
"plugins": [
"no-instanceof"
]
}
Then configure the rules you want to use under the rules section.
`json`
{
"rules": {
"no-instanceof/no-instanceof": 2
}
}
* no-instanceof`