UNPKG

3.49 kBMarkdownView Raw
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
18This module is for advanced users. You probably want to use [`standard`](http://standardjs.com) instead :)
19
20```bash
21npm install eslint-config-standard
22```
23
24## Usage
25
26Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
27You can learn more about
28[Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the
29official ESLint website.
30
31**If you want to set up the config automatically**, follow these steps in your project directory:
32
331. `npx eslint --init`
342. Select "Use a popular style guide."
353. Select "Standard."
364. Select a config file format.
375. If prompted, confirm the installation of the necessary dependencies.
38
39The 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
44npm install --save-dev eslint-config-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-n
45```
46
47Then, 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
57You 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
62The 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
64Node command line program (`standard`) that you can run or add to your `npm test` script
65to quickly check your style.
66
67## Badge
68
69Use this in one of your projects? Include one of these badges in your readme to
70let 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
86For 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
91MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).