React specific linting rules for ESLint
Перейти к файлу
Yannick Croissant 9773cfc72d Update History and bump version 2015-07-15 22:54:09 +00:00
docs/rules Add jsx-curly-spacing rule (fixes #142) 2015-07-11 00:08:05 +02:00
lib Update codebase for ESLint v1.0.0 2015-07-15 21:56:23 +00:00
tests Update codebase for ESLint v1.0.0 2015-07-15 21:56:23 +00:00
.editorconfig Update config files 2014-12-29 11:23:15 +01:00
.eslintignore Update config files 2014-12-29 11:23:15 +01:00
.eslintrc Update codebase for ESLint v1.0.0 2015-07-15 21:56:23 +00:00
.gitignore Update config files 2014-12-29 11:23:15 +01:00
.travis.yml Add io.js to travis builds 2015-02-24 01:11:36 +01:00
History.md Update History and bump version 2015-07-15 22:54:09 +00:00
LICENSE Initial commit 2014-12-16 00:44:14 +01:00
README.md Add no-danger to README 2015-07-13 15:09:42 -05:00
index.js Add jsx-curly-spacing rule (fixes #142) 2015-07-11 00:08:05 +02:00
package.json Update History and bump version 2015-07-15 22:54:09 +00:00

README.md

ESLint-plugin-React

Maintenance Status NPM version Build Status Dependency Status Coverage Status Code Climate

React specific linting rules for ESLint

Installation

Install ESLint either locally or globally.

npm install eslint

If you installed ESLint globally, you have to install React plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-react

Configuration

Add plugins section and specify ESLint-plugin-React as a plugin.

{
  "plugins": [
    "react"
  ]
}

If it is not already the case you must also configure ESLint to support JSX.

{
  "ecmaFeatures": {
    "jsx": true
  }
}

Finally, enable all of the rules that you would like to use.

{
  "rules": {
    "react/display-name": 1,
    "react/jsx-boolean-value": 1,
    "react/jsx-no-undef": 1,
    "react/jsx-quotes": 1,
    "react/jsx-sort-prop-types": 1,
    "react/jsx-sort-props": 1,
    "react/jsx-uses-react": 1,
    "react/jsx-uses-vars": 1,
    "react/no-danger": 1,
    "react/no-did-mount-set-state": 1,
    "react/no-did-update-set-state": 1,
    "react/no-multi-comp": 1,
    "react/no-unknown-property": 1,
    "react/prop-types": 1,
    "react/react-in-jsx-scope": 1,
    "react/require-extension": 1,
    "react/self-closing-comp": 1,
    "react/sort-comp": 1,
    "react/wrap-multilines": 1
  }
}

List of supported rules

To Do

Any rule idea is welcome !

License

ESLint-plugin-React is licensed under the MIT License.