Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukeapage/eslint-plugin-switch-case
https://github.com/lukeapage/eslint-plugin-switch-case
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lukeapage/eslint-plugin-switch-case
- Owner: lukeapage
- Created: 2016-07-17T04:08:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-02T12:41:02.000Z (3 months ago)
- Last Synced: 2024-10-14T18:34:50.561Z (25 days ago)
- Language: JavaScript
- Size: 386 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-eslint - Switch case - Switch-case-specific linting rules for ESLint. (Plugins / Style)
README
ESLint-Plugin-Switch-Case
=========================[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
Switch-case-specific linting rules for ESLint.
# Installation
Install [ESLint](https://www.github.com/eslint/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.
## Recommended configuration
This plugin exports a `recommended` configuration that enforces all the rules. You can configure the plugin as follows:```json
{
"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.### Stylistic Issues
These rules are purely matters of style and are quite subjective.
* [no-case-curly](docs/rules/no-case-curly.md): Forbid curly brackets around case statements.
* [newline-between-switch-case](docs/rules/newline-between-switch-case.md): Configure newlines around switch cases.# Contributing
Contributions are always welcome!.# License
eslint-plugin-switch-case is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
[npm-url]: https://npmjs.org/package/eslint-plugin-switch-case
[npm-image]: http://img.shields.io/npm/v/eslint-plugin-switch-case.svg?style=flat-square[travis-url]: https://travis-ci.org/lukeapage/eslint-plugin-switch-case
[travis-image]: http://img.shields.io/travis/lukeapage/eslint-plugin-switch-case/master.svg?style=flat-square[deps-url]: https://david-dm.org/lukeapage/eslint-plugin-switch-case
[deps-image]: https://img.shields.io/david/dev/lukeapage/eslint-plugin-switch-case.svg?style=flat-square[status-url]: https://github.com/lukeapage/eslint-plugin-switch-case/pulse
[status-image]: http://img.shields.io/badge/status-maintained-brightgreen.svg?style=flat-square