-
( 一般都是格式化后的错误)
-
用Standard标准创建的项目(它是一些前端工程师自定的标准)
或者下载这个依赖:eslint-config-standardnpm install eslint-config-standard eslint-plugin-standard eslint-plugin-promise -g
-
创建的项目的目录是这个样子的,会有一个 .editorconfig 文件
-
.editorconfig文件 要配合vscode的插件使用,下载插件
EditorConfig for VS Code
-
在.editorconfig文件 写入以下代码
# 告诉EditorConfig插件,这是根文件,不用继续往上查找 root = true # 匹配全部文件 [*] # 设置字符集 charset = utf-8 # 缩进风格,可选"space"、"tab" indent_style = space # 缩进的空格数 indent_size = 2 # 结尾换行符,可选"lf"、"cr"、"crlf" end_of_line = lf # 在文件结尾插入新行 insert_final_newline = true # 删除一行中的前后空格 trim_trailing_whitespace = true
.editorconfig文件配置官网:https://editorconfig.org/
-
重启项目就可以了
Vue3.0+ts填坑 Module Warning...error Unexpected tab character...19 problems (19 errors, 0 warnings)
最新推荐文章于 2024-05-03 22:17:14 发布