Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lukeapage/eslint-plugin-switch-case


https://github.com/lukeapage/eslint-plugin-switch-case

Last synced: 13 days ago
JSON representation

Awesome Lists containing this project

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