eslint-config-wiredrive-node-config
v1.1.16
Published
ESLINT configuration for Wiredrive nodeJS projects
Downloads
79
Readme
ESLINT Shareable Configuration for Wiredrive Node.js Projects
Overview
This repo contains a shareable ESLINT linter configuration file that can be ingested by ESLINT into any Node.js project. It is a collection of rules that the Wiredrive development team has standardized on to enable consistency across all of our projects and minimize the risk of simple coding errors getting to production.
Installation
When setting up a new project, please follow the following steps carefully to add automatic linter support.
Install the shareable ESLINT configuration as a dev-only dependency.
npm install eslint-config-wiredrive-node-config --save-dev
Install ESLINT as a a dev-only dependency.
npm install eslint --save-dev
Create local ESLINT configuration and ignore files at the root of your project.
touch .eslintrc.json
touch .eslintignore
Add the following code to each file:
.eslintrc.json
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"eslint-config-wiredrive-node-config"
]
}
.eslintignore
# Ignore test files
test/*
Add/commit both files to your GIT branch.
Automatically run linting before test execution by adding the following scripts to your packages.json file:
packages.json
"scripts": {
"lint": "./node_modules/.bin/eslint .",
"pretest": "npm run lint"
}
Add automatic ESLINT support to your favorite code editor so you can see errors as you type!
http://eslint.org/docs/user-guide/integrations