0.0.5 • Published 2 years ago
@iihll/eslint-config v0.0.5
@iihll/eslint-config
Usage
Install
pnpm add -D eslint @iihll/eslint-configConfig .eslintrc
{
"extends": "@iihll/eslint-config"
}You don't need
.eslintignorenormally as it has been provided by the preset.
Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Config VS Code auto fix
Install VS Code ESLint extension and create .vscode/settings.json
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}Lint Staged
If you want to apply lint and auto-fix before every commit, you can add the following to your package.json:
{
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}and then
npm i -D lint-staged simple-git-hooks