3.0.0 • Published 6 years ago

@neozenith/eslint-config v3.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

ESLint Config

Shareable ESLint Configuration to apply coding standards across javascript development.


Getting Started

Installation

Install peer dependencies and install the eslint configuration:

npm install --save-dev eslint prettier eslint-plugin-prettier eslint-config-prettier
npm install --save-dev @neozenith/eslint-config
echo "**/node_modules/**" >> .eslintignore

Configuration

Basic Configuration

Then add the following to your package.json:

{
  "eslintConfig":{ "extends": "@neozenith" }
}

Well that seems really simple right? And everyone gets the same rules, no excuses.

Advanced Configuration

In future, environment specific rules, would be specified as below:

  "eslintConfig":{
    "extends":[
      "@neozenith",
      "@neozenith/eslint-config/node"
    ]
  }
}

Scripts

Finally you'll want to add the following scripts to your package.json.

{

  "scripts": {
    "test:lint:all":"./node_modules/.bin/eslint --ignore-path .",
    "test:lint":"npm run test:lint -- --quiet",
    "test:lint:fix":"npm run test:lint -- --fix",
    "pretest":"npm run test:lint"
  }
}
  • test:lint:all - this will run eslint as per usual outputting all errors and warnings
  • test:lint - including the --quiet flag reduces eslint's output to errors only
  • test:lint:fix - this fixes all errors that are auto-fixable such as formatting issues that do not impact the semantics of the code. All prettier rules are always auto-fixable.
  • pretest - By running this before your tests it will enforce linting and halt on any errors preventing npm test from actually running until linting is satisfied. You may want to update this to test:lint:all so that it breaks on warnings too.

Maintaining

# Bump version number according to changes
npm version [major|minor|patch]

# Publish a public scoped repository
npm publish
3.0.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago