Note: The code comes from @antfu/eslint-config
pnpm add -D eslint @condorhero/eslint-config
# or with npm
npm install -D eslint @condorhero/eslint-config
For example .eslintrc
file:
{
"extends": "@condorhero"
}
You don't need
.eslintignore
normally as it has been provided by the preset.
Installing @condorhero/eslint-config
will apply all rules, It only needs Vue config.
pnpm add -D eslint @condorhero/eslint-config-vue
# or with npm
npm install -D eslint @condorhero/eslint-config-vue
eslint .eslintrc
file:
{
"extends": "@condorhero/eslint-config-vue"
}
Installing @condorhero/eslint-config
will apply all rules, It only needs React config.
pnpm add -D eslint @condorhero/eslint-config-react
# or with npm
npm install -D eslint @condorhero/eslint-config-react
eslint .eslintrc
file:
{
"extends": "@condorhero/eslint-config-react"
}
Installing @condorhero/eslint-config
will apply all rules, It only needs TypeScript config.
pnpm add -D eslint @condorhero/eslint-config-typescript
# or with npm
npm install -D eslint @condorhero/eslint-config-typescript
eslint .eslintrc
file:
{
"extends": "@condorhero/eslint-config-typescript"
}
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
Create .vscode/settings.json
{
"prettier.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}