为了提升VSCode中ESLint插件对文件的识别能力,我们需要为VSCode ESLint 配置文件扩展名。
在VSCode设置中增加如下配置:
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue",
"tsx"
],
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.tslint": true,
"source.fixAll.eslint"