@kevinmarrec/eslint-config
Based on @antfu/eslint-config by Anthony Fu :
- Single quotes, no semi
- Auto fix for formatting (aimed to be used standalone without Prettier)
- Designed to work with TypeScript, Vue out-of-box
- Lint also for json, yaml, markdown
- Sorted imports, dangling commas for cleaner commit diff
- Reasonable defaults, best practices, only one-line of config
Additionnally, this configuration overrides some rules to match my personal preferences :
-
@typescript-eslint/no-unused-vars
: Warning (warn
) instead of Error (error
) -
@typescript-eslint/space-before-function-paren
: Set toalways
for spaces before function parenthesis
Usage
Install
pnpm add -D eslint @kevinmarrec/eslint-config
.eslintrc
Config {
"extends": "@kevinmarrec"
}
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
}
}
Copyright
This configuration is based on @antfu/eslint-config by Anthony Fu
License
Made with ❤️
Published under the MIT License