|
| 1 | +# Standard React - ESLint Shareable Config |
| 2 | +[![travis][travis-image]][travis-url] |
| 3 | +[![npm][npm-image]][npm-url] |
| 4 | +[![downloads][downloads-image]][downloads-url] |
| 5 | + |
| 6 | +[travis-image]: https://img.shields.io/travis/feross/eslint-config-standard-jsx/master.svg |
| 7 | +[travis-url]: https://travis-ci.org/feross/eslint-config-standard-jsx |
| 8 | +[npm-image]: https://img.shields.io/npm/v/eslint-config-standard-jsx.svg |
| 9 | +[npm-url]: https://npmjs.org/package/eslint-config-standard-jsx |
| 10 | +[downloads-image]: https://img.shields.io/npm/dm/eslint-config-standard-jsx.svg |
| 11 | +[downloads-url]: https://npmjs.org/package/eslint-config-standard-jsx |
| 12 | + |
| 13 | +#### An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for JSX support in [JavaScript Standard Style](http://standardjs.com) |
| 14 | + |
| 15 | +This module is for advanced users. You probably want to use [`standard`](http://standardjs.com) instead :) |
| 16 | + |
| 17 | +[](http://standardjs.com) |
| 18 | + |
| 19 | +## Install |
| 20 | + |
| 21 | +```bash |
| 22 | +npm install eslint-config-standard-jsx |
| 23 | +``` |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | +Shareable configs are designed to work with the `extends` feature of `.eslintrc` files. |
| 28 | +You can learn more about |
| 29 | +[Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the |
| 30 | +official ESLint website. |
| 31 | + |
| 32 | +This Shareable Config adds extra JSX style rules to the baseline JavaScript Standard Style |
| 33 | +rules provided in |
| 34 | +[`eslint-config-standard`](https://www.npmjs.com/package/eslint-config-standard). |
| 35 | +It doesn't assume that you're using React, so other virtual DOM libraries like |
| 36 | +`virtual-dom` and `deku` are supported. |
| 37 | + |
| 38 | +Even thought this config is JSX only (no React), it makes use of |
| 39 | +[`eslint-plugin-react`](https://npmjs.com/package/eslint-plugin-react) for its generic |
| 40 | +JSX rules. |
| 41 | + |
| 42 | +(If you want React-specific rules too, consider using |
| 43 | +[`eslint-config-standard-react`](https://www.npmjs.com/package/eslint-config-standard-react) |
| 44 | +instead.) |
| 45 | + |
| 46 | +Here's how to install everything you need: |
| 47 | + |
| 48 | +```bash |
| 49 | +npm install eslint-config-standard eslint-config-standard-jsx eslint-plugin-react |
| 50 | +``` |
| 51 | + |
| 52 | +Then, add this to your .eslintrc file: |
| 53 | + |
| 54 | +``` |
| 55 | +{ |
| 56 | + "extends": ["standard", "standard-jsx"] |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +*Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint.* |
| 61 | + |
| 62 | +You can override settings from the shareable config by adding them directly into your |
| 63 | +`.eslintrc` file. |
| 64 | + |
| 65 | +### Looking for something easier than this? |
| 66 | + |
| 67 | +The easiest way to use JavaScript Standard Style to check your code is to use the |
| 68 | +[`standard`](http://standardjs.com) package. This comes with a global |
| 69 | +Node command line program (`standard`) that you can run or add to your `npm test` script |
| 70 | +to quickly check your style. |
| 71 | + |
| 72 | +## Badge |
| 73 | + |
| 74 | +Use this in one of your projects? Include one of these badges in your readme to |
| 75 | +let people know that your code is using the standard style. |
| 76 | + |
| 77 | +[](http://standardjs.com) |
| 78 | + |
| 79 | +```markdown |
| 80 | +[](http://standardjs.com) |
| 81 | +``` |
| 82 | + |
| 83 | +[](http://standardjs.com) |
| 84 | + |
| 85 | +```markdown |
| 86 | +[](http://standardjs.com) |
| 87 | +``` |
| 88 | + |
| 89 | +## Learn more |
| 90 | + |
| 91 | +For the full listing of rules, editor plugins, FAQs, and more, visit the main |
| 92 | +[JavaScript Standard Style repo](http://standardjs.com). |
| 93 | + |
| 94 | +## License |
| 95 | + |
| 96 | +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). |
0 commit comments