设为首页 加入收藏

TOP

eslint在webstorm中有错误警告(一)
2019-09-17 19:09:29 】 浏览:52
Tags:eslint webstorm 错误 警告

1. 报错Missing space before function parentheses的问题

  解决:在代码目录中,打开.eslint文件,并在rules中添加如下一行代码即可:

  

 

  "space-before-function-paren": 0

2. 报错eslint: missing semicolon

  解决:在rules中添加

  "semi": [2, "always"] // 设置强制加分号

 

 

3.报错eslint: string must be use singlequote
 
 解决:rules中添加
 "quotes": [1, "single"], //引号类型 `` "" ''


其他ESlint错误提示:
“Missing semicolon.” : “缺少分号.”,
“Use the function form of \”use strict\”.” : “使用标准化定义function.”,
“Unexpected space after ‘-’.” : “在’-'后面不应出现空格.”,
“Expected a JSON value.” : “请传入一个json的值.”,
“Mixed spaces and tabs.”: “空格和TAB重复.”,
“Unsafe character.” : “不安全的字符.”,
“Line too long.”: “本行中的字符超过设定的最大长度.”,
“Trailing whitespace.”: “本行末尾有过多无用空格.”,
“Script URL.” : “脚本URL.”,
“Unexpected {a} in ‘{b}’.” : “在 ‘{b}’ 中不该出现 {a}.”,
“Unexpected ‘{a}’.” : “不该在此出现’{a}’.”,
“Strings must use doublequote.” : “字符串需要用双引号”,
“Unnecessary escapement.” : “不需要转义”,
“Control character in string: {a}.” : “在字符串中出现了Control的字符”,
“Avoid \\’.” : “避免 \\”,
“Avoid \\v.” : “避免 \\v”,
“Avoid \\x-.” : “避免 \\x-”,
“Bad escapement.” : “错误的转义字符”,
“Bad number ‘{a}’.” : “错误的数字 ‘{a}’”,
“Missing space after ‘{a}’.” : “在’{a}’之后缺少空格”,
“Don’t use extra leading zeros ‘{a}’.” : “不要再’{a}’的前面用多余的0″,
“Avoid 0x-. ‘{a}’.” : “避免使用 0x-. ‘{a}’.”,
“A trailing decimal point can be confused with a dot ‘{a}’.” : “在’{a}’中使用点尾随小数点”,
“Unexpected comment.” : “不该在此处出现注释”,
“Unescaped ‘{a}’.” : “没有转义 ‘{a}’”,
“Unexpected control character in regular expression.” : “在正则表达式中出现了control字符”,
“Unexpected escaped character ‘{a}’ in regular expression.” : “在正则表达式中出现了没有转义的字符 ‘{a}’”,
“Expected ‘{a}’ and instead saw ‘{b}’.” : “应该用 ‘{a}’代替’{b}’”,
“Spaces are hard to count. Use {{a}}.” : “空格难以统计,请使用 {{a}}”,
“Insecure ‘{a}’.” : “不安全的 ‘{a}’”,
“Empty class.” : “空的class”,
“Expected a number and instead saw ‘{a}’.”:“应该用数字代替’{a}’”,
“‘{a}’ should not be greater than ‘{b}’.”:“‘{a}’不应该比’{b}’大”,
“‘hasOwnProperty’ is a really bad name.”: “‘hasOwnProperty’是关键字”,
“‘{a}’ was used before it was defined.”:“‘{a}’未定义就已经使用了.”,
“‘{a}’ is already defined.”:“‘{a}’被重复定义”,
“A dot following a number can be confused with a decimal point.”:“数字后面的一个点会被误认为是十进制的小数点”,
“Confusing minusses” : “容易混淆的负数表达-”,
“Confusing plusses.” : “容易混淆的正数表达+”,
“Unmatched ‘{a}’.” : “无法匹配的’{a}’”,
“Expected ‘{a}’ to match ‘{b}’ from line {c} and instead saw ‘{d}’.”:“在行{c}中需要用’{a}’和’{b}’匹配,用来代替’{d}’”,
“Unexpected early end of program.”:“程序不可预期的提前终止”,
“A leading decimal point can be confused with a dot: ‘.{a}’.”:“‘{a}’前的点容易混淆成小数点”,
“Use the array literal notation [].”:“使用数组的符号 []“,
“Expected an operator and instead saw ‘{a}’.”:“需要用一个符号来代替’{a}’”,
“Unexpected space after ‘{a}’.”:“在’{a}’之后不能出现空格”,
“Unexpected space before ‘{a}’.”:“在’{a}’之前不能出现空格”,
“Bad line breaking before ‘{a}’.”:“在’{a}’之前错误的换行”,
“Expected ‘{a}’ to have an indentation at {b} instead at {c}.”:“‘{a}’需要在{c}而不是{b}处缩进”,
“Line breaking error ‘{a}’.”:“换行错误 ‘{a}’”,
“Unexpected use of ‘{a}’.”:“此处不能用’{a}’”,
“Bad operand.”:“错误的操作数”,
“Use the isNaN function to compare with NaN.”:“使用isNaN来与NaN比较”,
“Confusing use of ‘{a}’.”:“容易混淆的’{a}’的使用”,
“Read only.”:“只读的属性”,
“‘{a}’ is a function.”:“‘{a}’是一个函数”,
‘Bad assignment.’:“错误的赋值”,
“Do not assign to the exception parameter.”:“不要给额外的参数赋值”,
“Expected an identifier in an assignment and instead saw a function invocation.”:“在赋值的语句中需要有一个标识符,而不是一个方法的调用”,
“E
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇【开源我写的富文本】打造全网最.. 下一篇egg-socket在egg中的使用

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目