@papb/linter
My custom linter configs and dependencies collected in one place to avoid repetition.
Why?
Until some time ago I was just using XO in my repos and overwriting a few rule configurations manually. However, XO now requires the project to be ESM and I don't want to do that. I don't want to stay locked in an old XO version either.
Install
$ npm install --save-dev eslint@^8 prettier@^2 @papb/linter
$ yarn add --dev eslint@^8 prettier@^2 @papb/linter
Usage
module.exports = require('@papb/linter').eslintrc();
module.exports = require('@papb/linter').prettierrc();
$ npx eslint . --max-warnings 0
$ npx prettier --check .
$ npx prettier --write .
Note: It is possible for ESLint to pass while prettier --check
still fails, so you should run both.
Recommended npm scripts:
{
"scripts": {
"lint": "eslint . --max-warnings 0 && prettier --check .",
"prettier": "prettier --write .",
}
}
License
MIT © Pedro Augusto de Paula Barbosa