diff --git a/README.md b/README.md index e872e11e77..e8d59c4263 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,15 @@ React specific linting rules for ESLint Install [ESLint](https://www.github.com/eslint/eslint) either locally or globally. - npm install eslint +```sh +$ 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 +```sh +$ npm install eslint-plugin-react +``` # Configuration @@ -46,8 +50,8 @@ Finally, enable all of the rules that you would like to use. "react/jsx-boolean-value": 1, "react/jsx-closing-bracket-location": 1, "react/jsx-curly-spacing": 1, - "react/jsx-max-props-per-line": 1, "react/jsx-indent-props": 1, + "react/jsx-max-props-per-line": 1, "react/jsx-no-duplicate-props": 1, "react/jsx-no-undef": 1, "react/jsx-quotes": 1, @@ -56,10 +60,10 @@ Finally, enable all of the rules that you would like to use. "react/jsx-uses-react": 1, "react/jsx-uses-vars": 1, "react/no-danger": 1, - "react/no-set-state": 1, "react/no-did-mount-set-state": 1, "react/no-did-update-set-state": 1, "react/no-multi-comp": 1, + "react/no-set-state": 1, "react/no-unknown-property": 1, "react/prop-types": 1, "react/react-in-jsx-scope": 1, @@ -73,12 +77,12 @@ Finally, enable all of the rules that you would like to use. # List of supported rules -* [display-name](docs/rules/display-name.md): Prevent missing displayName in a React component definition +* [display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition * [jsx-boolean-value](docs/rules/jsx-boolean-value.md): Enforce boolean attributes notation in JSX * [jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md): Validate closing bracket location in JSX * [jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes -* [jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md): Limit maximum of props on a single line in JSX * [jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX +* [jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md): Limit maximum of props on a single line in JSX * [jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md): Prevent duplicate props in JSX * [jsx-no-literals](docs/rules/jsx-no-literals.md): Prevent usage of unwrapped JSX strings * [jsx-no-undef](docs/rules/jsx-no-undef.md): Disallow undeclared variables in JSX @@ -88,13 +92,13 @@ Finally, enable all of the rules that you would like to use. * [jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused * [jsx-uses-vars](docs/rules/jsx-uses-vars.md): Prevent variables used in JSX to be incorrectly marked as unused * [no-danger](docs/rules/no-danger.md): Prevent usage of dangerous JSX properties -* [no-set-state](docs/rules/no-set-state.md): Prevent usage of setState -* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of setState in componentDidMount -* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of setState in componentDidUpdate +* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of `setState` in `componentDidMount` +* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of `setState` in `componentDidUpdate` * [no-multi-comp](docs/rules/no-multi-comp.md): Prevent multiple component definition per file +* [no-set-state](docs/rules/no-set-state.md): Prevent usage of `setState` * [no-unknown-property](docs/rules/no-unknown-property.md): Prevent usage of unknown DOM property * [prop-types](docs/rules/prop-types.md): Prevent missing props validation in a React component definition -* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing React when using JSX +* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing `React` when using JSX * [require-extension](docs/rules/require-extension.md): Restrict file extensions that may be required * [self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children * [sort-comp](docs/rules/sort-comp.md): Enforce component methods order