eslint-config-appnexus
Installation
npm install eslint-config-appnexus --save-dev
# Additional plugins needed
npm install eslint-plugin-import --save-dev
npm install eslint-plugin-lodash --save-dev
npm install eslint-plugin-promise --save-dev
Links
Configure .eslintrc.json
Base
View Config
{
"extends": [
"appnexus"
]
}
Base + UI Rules
View Config
{
"extends": [
"appnexus/frontend"
]
}
npm install eslint-plugin-react --save-dev
Base + Backend Rules
View Config
{
"extends": [
"appnexus/backend"
]
}
npm install eslint-plugin-hapi --save-dev
Overriding rules
To override rules for your project use the rules section of the .eslintrc.json file
Example overriding indentation to 2 spaces:
{
"extends": [
"appnexus"
],
"rules": {
"indent": ["error", 2]
}
}
Example of adding mocha defined functions:
{
"env": {
"mocha": true
},
"extends": [
"appnexus"
]
}
Rule Changes
See the wiki for the semver policy for this project. Please propose rule changes as an issue in this repo.
Find Unused Rules
npm run find-unused-rules -- base.js
npm run find-unused-rules -- frontend.js
npm run find-unused-rules -- backend.js