1.0.0 • Published 8 years ago
eslint-plugin-no-switch-statements
Licence
MIT
Version
1.0.0
Deps
3
Size
5 kB
Vulns
0
Weekly
0
eslint-plugin-no-switch-statements
ESLint rule for disallowing the switch statement
Install
$ npm install --save-dev eslint eslint-plugin-no-switch-statements
Usage
Configure it in package.json.
{
"name": "my-awesome-project",
"eslintConfig": {
"plugins": [
"no-switch-statements"
],
"rules": {
"no-switch-statements/no-switch": "error"
}
}
}
Rules
- no-switch - prevent the usage of switch statements
Recommended configuration
This plugin exports a recommended configuration that enforces good practices.
To enable this configuration, use the extends property in your package.json.
{
"name": "my-awesome-project",
"eslintConfig": {
"plugins": [
"no-switch-statements"
],
"extends": "plugin:no-switch-statements/recommended"
}
}
See ESLint documentation for more information about extending configuration files.
MIT Andreas Wiedel