常见问题

发布时间 2023-08-12 11:33:10作者: dimiaslong

vscode自动将CRLF格式转为LF格式

image

警告:Delete CR eslint

原因: 换行符为CRLF格式的, 应该改为LF格式(这个文件之前是被苹果电脑编辑过)

解决方法:

  1. 安装插件EditorConfig for VS Code
  2. 在根目录新建文件.editorconfig
  3. 写入以下代码
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

'xxx' should always be multi-word

警告:Component name "Login" should always be multi-word

image解决: 在eslintrc.cjs文件里面输入

 rules: {
     "vue/multi-word-component-names": "off",
  },

tailwindcss的@apply规则触发警告

image

原因: vscode不认识@apply这个语法

解决:在vscode的配置文件setting.json​里面, 添加一条语句

 "css.lint.unknownAtRules": "ignore