eslint-plugin-no-switch-statements

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i eslint-plugin-no-switch-statements

Weekly Downloads

326

Version

1.0.0

License

MIT

Unpacked Size

4.94 kB

Total Files

6

Last publish

Collaborators

  • kaishiyoku