0.3.1 • Published 1 year ago
@brzezinskimarcin/eslint-config v0.3.1
@brzezinskimarcin/eslint-config 🎨
ESlint config based on antfu/eslint-config with the following differences:
- require semicolons
- prefer one true brace style
- always require curly brackets
- for typescript projects: prohibit enums
- some more strict checks, especially for typescript and vue
- built-in support for pug
Usage
Install
pnpm add -D eslint @brzezinskimarcin/eslint-config
Config .eslintrc.js
JavaScript:
module.exports = {
extends: '@brzezinskimarcin'
}
You don't need
.eslintignore
normally as it has been provided by the preset.
TypeScript :
process.env.ESLINT_TSCONFIG = 'tsconfig.json';
module.exports = {
extends: '@brzezinskimarcin'
}
It assumes your file with typescript configuration is named
tsconfig.json
.
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
}
}
License
- original: MIT License © 2019-PRESENT Anthony Fu
- modifications: MIT License © 2023-PRESENT Marcin Brzeziński