eslint-plugin-switch-case

switch-case specific linting rules for ESLint

MIT 9 个版本
安装
npm install eslint-plugin-switch-case
yarn add eslint-plugin-switch-case
pnpm add eslint-plugin-switch-case
bun add eslint-plugin-switch-case
README

ESLint-Plugin-Switch-Case

Maintenance Status NPM version Build Status

Switch-case-specific linting rules for ESLint.

Installation

Install ESLint either locally or globally.

$ npm install eslint

If you installed ESLint globally, you have to install the plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-switch-case

Configuration

Add a plugins section and specify eslint-plugin-switch-case as a plugin.

Then, enable all of the rules that you would like to use.

This plugin exports a recommended configuration that enforces all the rules. You can configure the plugin as follows:

{
  "plugins": ["switch-case"],
  "extends": ["plugin:switch-case/recommended"]
}

List of provided rules

Rules are divided into categories for your convenience. All rules are off by default, unless you use one of the plugin's configurations which turn all relevant rules on.

Possible Errors

These rules relate to possible logic errors in code.

Stylistic Issues

These rules are purely matters of style and are quite subjective.

Contributing

Contributions are always welcome!.

License

eslint-plugin-switch-case is licensed under the MIT License.

版本列表
4.0.0 2026-03-22
3.0.1 2024-08-02
3.0.0 2024-08-02
1.1.2 2016-08-01
1.1.1 2016-07-23
1.1.0 2016-07-17
1.0.1 2016-07-17
1.0.0 2016-07-17
0.0.1 2016-07-17