@jiqi/eslint-config
Forked from antfu/eslint-config
Usage
Install
# vue eslint
pnpm add -D eslint @jiqi/eslint-config
# react eslint
pnpm add -D eslint @jiqi/eslint-config-react
# ts eslint
pnpm add -D eslint @jiqi/eslint-config-ts
# basic eslint
pnpm add -D eslint @jiqi/eslint-config-basic
# prettier config
pnpm add -D eslint @jiqi/eslint-config-prettier
.eslintrc
Config {
"extends": "@jiqi"
}
You don't need
.eslintignore
normally as it has been provided by the preset.
{
"printWidth": 80,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"bracketSameLine": false,
"arrowParens": "avoid",
"tabWidth": 2,
"useTabs": false
}
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
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}