UNPKG

2.17 kB Markdown View Raw
1# RdBird eslint-config
2
3[![Version][version-svg]][package-url] [![Build Status][circleci-svg]][circleci-url] [![License][license-image]][license-url]
4
5This package provides RdBird's [ESLint](http://eslint.org) configuration as an extensible shared config.
6
7<!-- START doctoc generated TOC please keep comment here to allow auto update -->
8<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
9
10
11- [How to use it in your project](#how-to-use-it-in-your-project)
12 - [1. Install dependency](#1-install-dependency)
13 - [2. Update `.eslintrc.json`](#2-update-eslintrcjson)
14 - [3. Update `package.json`](#3-update-packagejson)
15- [Architecture](#architecture)
16
17<!-- END doctoc generated TOC please keep comment here to allow auto update -->
18
19## How to use it in your project
20
21### Setup requirements
22```sh
23npm install \
24eslint babel-eslint prettier \
25@rdbird/eslint-config \
26--save-dev
27```
28
29### Configure eslint
30
31#### Use all plugins
32***.eslintrc.json***
33```json
34{
35 "extends": [
36 "@rdbird/eslint-config"
37 ]
38}
39```
40
41*OR*
42
43#### Cherry-pick plugins
44***.eslintrc.json***
45```json
46{
47 "extends": [
48 "@rdbird/eslint-config/base",
49 "@rdbird/eslint-config/react",
50 "@rdbird/eslint-config/jsx-a11y",
51 "@rdbird/eslint-config/flowtype"
52 ]
53}
54```
55
56### Setup the lint task
57
58***package.json***
59```json
60{
61 "scripts": {
62 "lint": "eslint .",
63 "format": "eslint . --fix"
64 }
65}
66```
67
68## Architecture
69
70For a better community alignment, the configuration extends [StandardJS](https://standardjs.com/). Inspiration also comes from:
71* [AirBnB](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base)
72* [Algolia](https://github.com/algolia/eslint-config-algolia)
73* [Supermind](https://github.com/supermind/eslint-config-supermind)
74
75[version-svg]: https://img.shields.io/npm/v/@rdbird/eslint-config.svg?style=flat-square
76[package-url]: https://www.npmjs.com/package/@rdbird/eslint-config
77[circleci-svg]: https://circleci.com/gh/RdBird/eslint-config.svg?style=shield
78[circleci-url]: https://circleci.com/gh/RdBird/eslint-config
79[license-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square
80[license-url]: LICENSE