7.1.2 • Published 2 years ago
eslint-config-appnexus v7.1.2
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
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"
}
Links
Configure .eslintrc.json
Base
{
"extends": ["appnexus"]
}
Base + UI Rules
{
"extends": ["appnexus/frontend"]
}
Additional installs
npm install eslint-plugin-react --save-dev
Base + Backend Rules
{
"extends": ["appnexus/backend"]
}
Additional installs
npm install eslint-plugin-hapi --save-dev
Typescript Base
{
"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",
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
7.1.2
2 years ago
7.1.1
3 years ago
7.1.0
4 years ago
7.0.1
4 years ago
7.0.0
4 years ago
6.2.0
4 years ago
6.1.0
4 years ago
6.0.0
4 years ago
5.0.0
4 years ago
4.1.0
4 years ago
4.0.0
4 years ago
3.1.2
4 years ago
3.1.1
4 years ago
3.1.0
5 years ago
3.0.0
5 years ago
3.0.0-0
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
2.0.0-0
5 years ago
1.6.0
7 years ago
1.5.1
7 years ago
1.5.0
7 years ago
1.4.0
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago