eslint-config-iamnewton

1.2.0 • Public • Published

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

/eslint-config-iamnewton/

    Package Sidebar

    Install

    npm i eslint-config-iamnewton

    Weekly Downloads

    1

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    16.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • chrisopedia