1.2.0 • Published 4 years ago

eslint-config-iamnewton v1.2.0

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

ESLint Config

An ESLint configuration for JS development.

Installation

npm install --save-dev eslint-config-iamnewton

Usage

In your project package.json add the following:

{
  "eslintConfig": {
    "extends": "iamnewton"
  }
}

Rules

  • Four (4) space
  • Semicolons
  • Sort JSX Props: errors; sorted alphabetically, with shorthand first
  • Sort Imports: errors; sorted alphabetically by import with grouping order of "builtin", "external", "parent", "sibling", and "index"
  • Switch statements updates
    • No Case Declarations: errors, all; requires {} in all cases/defaults of the Switch statement to prevent hoisting
    • Curly: errors; require {} in all code regardless of single line availability
  • React hooks plugin
    • error; only call hooks at the top-level
    • error; only call hooks from React functions
    • warn; don't include props in hooks that are not referenced
    • Further reading

For a more complete listing of rules you can check out the eslintrc.json