基于eslint-plugin-mpx插件,集成js和ts的推荐(recommended)配置 升级了eslintv9版本支持flatConfig。
# js版本
pnpm add -D eslint @mpxjs/eslint-config
import { mpxConfig } from '@mpxjs/eslint-config'
export default mpxConfig(
{
mpx: true,
vue: true,
typescript: true
}
)
For example:
{
"scripts": {
"lint": "eslint --ext .js,.ts,.mpx src",
"lint:fix": "eslint --fix --ext .js,.ts,.mpx src"
}
}
Create .vscode/settings.json
{
"prettier.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}