0.1.4 • Published 8 years ago

@gabehayes/eslint-config-react v0.1.4

Weekly downloads
7
License
MIT
Repository
-
Last release
8 years ago

eslint-config-react

Check out eslint-config-airbnb for a list of all the rules we are inheriting.

Table of Contents

  1. Installation
  2. Rules
    1. react/no-set-state
    2. react/sort-comp

Installation

Install the package.

yarn add @keenai/eslint-config-react

Then, extend @keenai/react in your ESLint configuration file.

{
  extends: [
    '@keenai/react',
  ],
}

Rules

react/no-set-state

We use Redux for state management. This should probably be a warning, because there may be a situation where using state would be the correct solution. Anyway, it's an error.

react/sort-comp

Will warn if you do not sort your component properties in the expected order:

  1. Type annotations
  2. Static methods
  3. Lifecycle methods
  4. Handler methods (onThis, onThat)
  5. Getter methods
  6. Setter methods
  7. Everything else
  8. Render methods
  9. Render