UNPKG

1.86 kBMarkdownView Raw
1# eslint-plugin-standard [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
2
3[travis-image]: https://img.shields.io/travis/standard/eslint-plugin-standard/master.svg
4[travis-url]: https://travis-ci.org/standard/eslint-plugin-standard
5[npm-image]: https://img.shields.io/npm/v/eslint-plugin-standard.svg
6[npm-url]: https://npmjs.org/package/eslint-plugin-standard
7[downloads-image]: https://img.shields.io/npm/dm/eslint-plugin-standard.svg
8[downloads-url]: https://npmjs.org/package/eslint-plugin-standard
9[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
10[standard-url]: https://standardjs.com
11
12ESlint Rules for the Standard Linter
13
14### Usage
15
16`npm install --save-dev eslint-plugin-standard`
17
18### Configuration
19
20```js
21{
22 rules: {
23 'standard/object-curly-even-spacing': [2, "either"]
24 'standard/array-bracket-even-spacing': [2, "either"],
25 'standard/computed-property-even-spacing': [2, "even"]
26 'standard/no-callback-literal': [2, ["cb", "callback"]]
27 }
28}
29```
30
31### Rules Explanations
32
33There are several rules that were created specifically for the `standard` linter.
34
35- `object-curly-even-spacing` - Like `object-curly-spacing` from ESLint except it has an `either` option which lets you have 1 or 0 spaces padding.
36- `array-bracket-even-spacing` - Like `array-bracket-even-spacing` from ESLint except it has an `either` option which lets you have 1 or 0 spacing padding.
37- `computed-property-even-spacing` - Like `computed-property-spacing` around ESLint except is has an `even` option which lets you have 1 or 0 spacing padding.
38- `no-callback-literal` - Ensures that we strictly follow the callback pattern with `undefined`, `null` or an error object in the first position of a callback.
39