1 | # eslint-config-standard [![CI][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
|
2 |
|
3 | [ci-image]: https://github.com/standard/eslint-config-standard/actions/workflows/ci.yml/badge.svg?branch=master
|
4 | [ci-url]: https://github.com/standard/eslint-config-standard/actions/workflows/ci.yml
|
5 | [npm-image]: https://img.shields.io/npm/v/eslint-config-standard.svg
|
6 | [npm-url]: https://npmjs.org/package/eslint-config-standard
|
7 | [downloads-image]: https://img.shields.io/npm/dm/eslint-config-standard.svg
|
8 | [downloads-url]: https://npmjs.org/package/eslint-config-standard
|
9 | [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
|
10 | [standard-url]: https://standardjs.com
|
11 |
|
12 | #### An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for [JavaScript Standard Style](http://standardjs.com)
|
13 |
|
14 | [![JavaScript Style Guide - Standard Style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com)
|
15 |
|
16 | ## Install
|
17 |
|
18 | This module is for advanced users. You probably want to use [`standard`](http://standardjs.com) instead :)
|
19 |
|
20 | ```bash
|
21 | npm install eslint-config-standard
|
22 | ```
|
23 |
|
24 | ## Usage
|
25 |
|
26 | Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
|
27 | You can learn more about
|
28 | [Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the
|
29 | official ESLint website.
|
30 |
|
31 | **If you want to set up the config automatically**, follow these steps in your project directory:
|
32 |
|
33 | 1. `npx eslint --init`
|
34 | 2. Select "Use a popular style guide."
|
35 | 3. Select "Standard."
|
36 | 4. Select a config file format.
|
37 | 5. If prompted, confirm the installation of the necessary dependencies.
|
38 |
|
39 | The above steps will automatically set up an ESLint configuration and install the necessary dependencies for you.
|
40 |
|
41 | **If you want to set up the config manually**, run the following command:
|
42 |
|
43 | ```bash
|
44 | npm install --save-dev eslint-config-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-n
|
45 | ```
|
46 |
|
47 | Then, add this to your `.eslintrc` file:
|
48 |
|
49 | ```
|
50 | {
|
51 | "extends": "standard"
|
52 | }
|
53 | ```
|
54 |
|
55 | *Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint.*
|
56 |
|
57 | You can override settings from the shareable config by adding them directly into your
|
58 | `.eslintrc` file.
|
59 |
|
60 | ### Looking for something easier than this?
|
61 |
|
62 | The easiest way to use JavaScript Standard Style to check your code is to use the
|
63 | [`standard`](http://standardjs.com) package. This comes with a global
|
64 | Node command line program (`standard`) that you can run or add to your `npm test` script
|
65 | to quickly check your style.
|
66 |
|
67 | ## Badge
|
68 |
|
69 | Use this in one of your projects? Include one of these badges in your readme to
|
70 | let people know that your code is using the standard style.
|
71 |
|
72 | [![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com)
|
73 |
|
74 | ```markdown
|
75 | [![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com)
|
76 | ```
|
77 |
|
78 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
|
79 |
|
80 | ```markdown
|
81 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
|
82 | ```
|
83 |
|
84 | ## Learn more
|
85 |
|
86 | For the full listing of rules, editor plugins, FAQs, and more, visit the main
|
87 | [JavaScript Standard Style repo](http://standardjs.com).
|
88 |
|
89 | ## License
|
90 |
|
91 | MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
|