Closed Popxie closed 3 years ago
创建一个 .vscode/settings.json 文件,然后贴入以下内容
{
// 统一使用 \n 换行符
"files.eol": "\n",
// 缩进宽度为 2
"editor.tabSize": 2,
// 保存时自动格式化
"editor.formatOnSave": true,
// 默认使用 Prettier 格式化
// "editor.defaultFormatter": "esbenp.prettier-vscode",
// ESLint 配置
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"editor.codeActionsOnSave": {
// 保存时自动修复 ESLint 错误
"source.fixAll.eslint": true
},
// 使用项目的 ts 版本
"typescript.tsdk": "node_modules/typescript/lib",
// "deno.enable": false
}
按照使用文档说明, 安装了依赖,生成了
.eslintrc
文件(默认数据),然后启动项目,在代码中刻意输入不符合规则的代码,为啥没有任何提示且项目依旧正常运行?最开始使用vue项目自动配置的eslint时,会直接报错,结果改用eslint-config-alloy
时没有任何效果、请问是我哪里出了问题嘛?此时vscode
我没有进行任何设置。是我哪里姿势不对嘛?????