vscode莫名其妙的错误:eslint的语法校验规则

发布时间 2023-03-27 16:06:11作者: 一乐乐

1、 报错信息:
image

http://eslint.org/docs/rules/eol-last 翻译:文档末尾要换行

2、分析原因:插件或相关配置eslint的语法进行校验,代码规范不符合校验规则。

3、解决:回车键换行一下

image

4、eslint的语法校验规则常见的错误:

	Errors:
         1.http://eslint.org/docs/rules/eol-last    表示:文档末尾要换行

       Errors:
         2  http://eslint.org/docs/rules/spaced-comment   表示: // 注释后要跟空格

      Errors:
         3  http://eslint.org/docs/rules/indent    表示:缩进错误,设置'indent':0

      Errors:
         4  http://eslint.org/docs/rules/no-tabs    表示:tab缩进错误