背景
操作系统:win10
编辑器:vscode
项目:vue cli3 + typescript
目的:配置保存时自动格式化代码并且修复可修复的eslint语法错误
生成项目配置
命令:
vue create
linter配置选择ESLint+Prettier:
Vue CLI v3.6.3
┌───────────────────────────┐
│ Update available: 4.0.5 │
└───────────────────────────┘
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Router, Vuex, CSS Pre-processors, Linter, Unit
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript for auto-detected polyfills? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with node-sass)
? Pick a linter / formatter c