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
npm install eslint-plugin-prettier --save-dev
npm install --save-dev --save-exact prettier
Create a .prettierrc
file in the project root with the standard overrides:
{
"printWidth": 120,
"singleQuote": true,
"arrowParens": "always",
"semi": true,
"trailingComma": "all"
}
{
"extends": ["appnexus"]
}
{
"extends": ["appnexus/frontend"]
}
Additional installs
npm install eslint-plugin-react --save-dev
{
"extends": ["appnexus/backend"]
}
Additional installs
npm install eslint-plugin-hapi --save-dev
{
"extends": ["appnexus/typescript"]
}
Additional installs
npm install @typescript-eslint/eslint-plugin@latest --save-dev
npm install eslint-plugin-import@latest --save-dev
package.json scripts:
"lint": "eslint --ext .js,.jsx,.ts,.tsx src",
"lint-fix": "eslint --ext .js,.jsx,.ts,.tsx src --fix",
To override rules for your project use the rules section of the .eslintrc.json file
{
"extends": ["appnexus"],
"rules": {
"indent": ["error", 2]
}
}
{
"env": {
"mocha": true
},
"extends": ["appnexus"]
}
See the wiki for the semver policy for this project. Please propose rule changes as an issue in this repo.
npm run find-unused-rules -- base.js
npm run find-unused-rules -- frontend.js
npm run find-unused-rules -- backend.js