@salestrip/eslint-config
v2.2.0
Published
SalesTrip ESLint configuration
Downloads
13
Readme
@salestrip/eslint-config
If you'd like to add or change an eslint rule open a PR and use gh-polls to solicit team voting: https://app.gh-polls.com/.
Install
Install peer dependencies along with the module.
npm i -D eslint
npm i -D eslint-plugin-jest
npm i -D eslint-plugin-prettier
npm i -D prettier
npm i -D prettier-eslint-cli
npm i -D @salestrip/eslint-config
Use
Create the following .eslintrc
file in your project root.
{
"extends": "@salestrip",
"root": true
}
Then create a test/.eslintrc
file with the following content.
{
"extends": "@salestrip/eslint-config/configs/jest"
}
This module provides a format
binary that executes prettier code formatting followed by an eslint 'stroustrup' brace style and property quote corrections to align with eslint config. Add the following npm task to your package.json
.
"scripts": {
"format": "format '{lib,test}/**/*.js'"
}
Lint
A pre-lint script symlinks the project to itself so you can dog food the config settings while a post-lint script removes the symlinks. Note that this would remove any existing global symlink so you would need to run npm link
again to restore it.
npm run lint