5.0.1 • Published 5 years ago

@neogeek/eslint-config-standards v5.0.1

Weekly downloads
46
License
MIT
Repository
github
Last release
5 years ago

ESLint Config Standards

Build Status NPM Version

Install

$ npm install eslint babel-eslint @neogeek/eslint-config-standards --save-dev

Then create a .eslintrc file in the root of your project with the following contents:

{
    "extends": ["@neogeek/eslint-config-standards"]
}

Configuration

See http://eslint.org/docs/rules/ for more information.

This package enables errors on all of the available flags except the following:

Best Practices

FlagDescriptionValue
dot-locationEnforce consistent newlines before and after dots0
no-magic-numberDisallow Magic Numbers[2, {"ignore": [-1, 0, 1]}]

ECMAScript 6

FlagDescriptionValue
arrow-parensrequire parentheses around arrow function arguments["error", "as-needed"]

Stylistic Issues

FlagDescriptionValue
implicit-arrow-linebreakEnforce the location of arrow function bodies with implicit returns0
max-lenEnforce a maximum line length[1, 80, 4, {"ignoreComments": true, "ignoreTemplateLiterals": true}]
max-linesEnforce a maximum file length0
object-curly-newlineEnforce consistent line breaks inside braces0
one-varEnforce variables to be declared either together or separately in functions0
quotesEnforce the consistent use of either backticks, double, or single quotes[2, "single"]
spaced-commentenforce consistent spacing after the // or /* in a comment["error", "always", {"block": {"markers": ["!"]}}]

Variables

FlagDescriptionValue
no-shadowdisallow variable declarations from shadowing variables declared in the outer scope["error", {"allow": ["err"]}]
no-unused-varsdisallow unused variables"no-unused-vars": ["warn", {"ignoreRestSiblings": true}]

Extended .eslintrc Configuration

{
    "extends": [
        "@neogeek/eslint-config-standards/.eslintrc-best-practices",
        "@neogeek/eslint-config-standards/.eslintrc-ecmascript-6",
        "@neogeek/eslint-config-standards/.eslintrc-possible-errors",
        "@neogeek/eslint-config-standards/.eslintrc-react",
        "@neogeek/eslint-config-standards/.eslintrc-strict-mode",
        "@neogeek/eslint-config-standards/.eslintrc-stylistic-issues",
        "@neogeek/eslint-config-standards/.eslintrc-variables"
    ],
    "rules": {
        "quotes": [2, "double"]
    }
}
{
    "extends": ["@neogeek/eslint-config-standards/.eslintrc-tests"]
}

Prettier Config

Create a .prettierrc file with the following contents:

{
    "printWidth": 80,
    "tabWidth": 4
}

Install the prettier-eslint-cli.

$ npm install prettier-eslint-cli --save-dev

Add NPM script for automation.

{
    "scripts": {
        "prettier": "prettier-eslint --eslint-config-path .eslintrc --write \"src/**/*.js\""
    }
}
5.0.1

5 years ago

5.0.0

5 years ago

4.2.0

7 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.0.0

8 years ago

2.0.0

9 years ago

1.15.0

9 years ago

1.14.0

9 years ago

1.13.1

9 years ago

1.13.0

9 years ago

1.12.0

9 years ago

1.11.0

9 years ago

1.10.0

9 years ago

1.9.0

9 years ago

1.8.0

9 years ago

1.7.0

9 years ago

1.6.4

9 years ago

1.6.3

10 years ago

1.6.2

10 years ago

1.6.1

10 years ago

1.6.0

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago