Recently in the use of Eslint code detection, because not too much attention to code specifications, just started really headache, haha, but used to feel good, in fact, it is not so difficult to debug
I have seen before some people have done a summary, their own record, convenient for their later search
"Missing semicolon.": "Missing semicolon.",
"Using the function form of \" use Strict\. ":" Define function with normalization. ",
"Unexpected space after '-'.": "There should be no spaces after '-'.",
"Expected a JSON value.": "Please pass in one of the JSON values.",
"Mixed Spaces and Tabs.": "Spaces and Tab repeats.",
"Unsafe character.": "unsafe characters.",
"Line too long.": "The characters in the bank exceed the maximum length set.",
"Trailing whitespace.": "There are too many useless spaces at the end of the bank.",
"Script URL.": "Scripting URL.",
"Unexpected {A} in ' {b} '.": "{A} should not appear in ' {b} '.",
"Unexpected ' {a} '.": "should not appear here ' {a} '.",
"Strings must use Doublequote.": "The string needs to be in double quotes",
"Unnecessary escapement.": "No escaping required",
"Control character in string: {a}.": "A control character appears in a string",
"Avoid \ \": "Avoid \ \",
"Avoid \\v.": "Avoid \\v",
"Avoid \\x-.": "Avoid \\x-",
"Bad escapement.": "False escape character",
"Bad number ' {a} '.": "wrong digit ' {a} '",
"Missing space after ' {a} '.": "Missing spaces after ' {a} ',
"Don ' t use extra leading zeros ' {a} '.": "Do not precede ' {a} ' with redundant 0″,
"Avoid 0x-." {a} '. ': ' Avoid using 0x-. ' {a} '. ',
"A trailing decimal point can be confused with A dot ' {a} '.": "Use dot trailing decimal in ' {A} ',
"Unexpected comment.": "The comment should not appear here",
"Unescaped ' {a} '.": "No escaping ' {a} ',
"Unexpected control character in regular expression.": "The control character appears in the regular expression",
"Unexpected escaped character ' {a} ' in regular expression.": "There is no escaped character ' {a} ' in the regular expression,
"Expected ' {a} ' and instead saw ' {b} '.": "instead of ' {B} ' with ' {a} ',
"Spaces is hard to count. Use {{a}}. ":" Space is difficult to count, using {{A}} ",
"Insecure ' {a} '.": "Unsafe ' {A} '",
"Empty class": "Null Class",
"Expected a number and instead saw ' {a} '.": "instead of ' {a} ' with numbers,
"' {A} ' should not being greater than ' {B} '.": "' {a} ' should not be larger than ' {b} ',
"' hasOwnProperty ' is a really bad name.": "' hasownproperty ' is the keyword",
"' {A} ' was used before it was defined.": "' {a} ' is not defined and is already in use.",
"' {A} ' is already defined.": "' {a} ' was defined repeatedly",
"A dot following a number can be confused with a decimal point.": "A dot behind a digit is mistaken for a decimal point",
"Confusing minusses": "Easily confusing negative expression-",
"Confusing plusses.": "Easy to confuse positive expression +",
"Unmatched ' {a} '.": "cannot match ' {A} '",
"Expected ' {a} ' to match ' {B} ' from line {C} ' and instead saw ' {D} '.": "The line {C} needs to be matched with ' {a} ' and ' {b} ' to replace ' {D} ',
"Unexpected early end of program.": "Unexpected premature termination of programs",
"A Leading decimal point can is confused with A dot: '. {a} '. ': ' The point in front of ' {A} ' is easily confused with a decimal point,
"Use the array literal notation [].": "Using the array's symbol []",
"Expected an operator and instead saw ' {a} '.": "Need a symbol instead of ' {a} ',
"Unexpected space after ' {a} '.": "cannot appear after ' {A} ',
"Unexpected space before ' {a} '.": "The space cannot appear before ' {A} ',
"Bad line breaking before ' {a} '.": "Wrong newline before ' {a} ',
"Expected ' {a} ' to has a indentation at {b} instead at {C}.": "' {a} ' needs to be indented at {C} instead of {B}",
"Line breaking error ' {a} '.": "NewLine Errors ' {a} '",
"Unexpected use of ' {a} '.": "cannot be used here ' {a} '",
"Bad operand.": "Wrong operand",
"Use the IsNaN function to compare with Nan.": "Using IsNaN to compare with Nan",
"Confusing use of ' {a} '.": "Easy to confuse ' {a} ' using",
"Read only.": "Read-only Properties",
"' {A} ' is a function.": "' {A} ' is a functions",
' Bad assignment. ': ' Wrong assignment ',
"Do not assign to the exception parameter.": "Don't Assign additional parameters",
"Expected an identifier in an assignment and instead saw a function invocation.": "You need an identifier in the assignment statement, not a call to a method",
"Expected an identifier and instead saw ' {a} ' (a reserved word).": "requires an identifier instead of ' {a} ' (Reserved character)",
"Missing name in function declaration.": "Missing names in method declarations",
"Expected an identifier and instead saw ' {a} '.": "requires an identifier, not ' {a} ',
"Inner functions should is listed at the top of the outer function.": "The declaration of an intrinsic function should be placed at the top of this function. ”,
"Unreachable ' {a} ' after ' {b} '.": "Cannot get ' {a} ' after ' {b} '",
"Unnecessary semicolon.": "Unnecessary semicolon",
"Label ' {A} ' on {b} statement.": "Place ' {a} ' in the declaration of {B}",
"Label ' {A} ' looks like a JavaScript URL.": "' {a} ' seems to be a JS link",
"Expected an assignment or function calls and instead saw an expression": "Requires an assignment or a function call, not an expression.",
"Do not use the ' new ' for Side effects.": "No ' new ' statement.",
"Unnecessary \" "Use Strict\". ":" Unnecessary \ "Use Strict\". ",
"Missing \" use strict\ "statement.": "Missing \" use strict\ "declaration",
"Empty block.": "Blank Module",
"Unexpected/*member ' {a} '.": "The/* element should not appear ' {a} '.",
"' {A} ' is a statement label.": "' {A} ' is a declaration",
"' {A} ' used out of scope.": "' {a} ' use out of range ',
' {A} ' is not allowed. ': ' does not allow ' {a} ',
"' {A} ' is not defined.": "' {a} ' was not defined",
"Use ' {a} ' to compare with ' {b} '.": "Compared to ' {b} ' using ' {a} '
"Variables should not being deleted.": "Variable needs to be removed",
"Use the object literal notation {}.": "Using the object's text symbol {}",
"Do" uses {a} as a constructor. ":" Don't use {a} as a constructed object ",
"The function constructor is eval.": "The function constructor is eval.",
"A constructor name should start with the uppercase letter.": "The name of a constructed object must begin with uppercase letters.",
"Bad constructor.": "Wrong Construction object",
"Weird construction. Delete ' new '. ': ' The constructed object is wrong, please remove ' new ',
"Missing ' () ' invoking a constructor.": "Missing Parentheses ()",
"Avoid arguments. {a}. ":" to avoid parameters. {a}. ",
"Document.Write can be a form of eval.": "Document.Write is a form of eval",
' Eval is evil. ': "Try not to use eval",
"Math is not a function." ":" Math isn't a functional ",
"Missing ' new ' prefix when invoking a constructor.": "Here is missing ' new ',
"Missing radix parameter.": "Missing Parameters",
"Implied eval is evil. Pass a function instead of a string. ":" passes a function instead of a string ",
"Bad invocation.": "Wrong Call",
"[' {a} '] is better written in dot notation.": "[' {a} '] it's best to use dots."
"Extra comma.": "Extra comma",
"Don't make functions within a loop.": "Do not create functions in a circular way,"
"Unexpected parameter ' {a} ' in get {b} function.": "The parameter ' {a} ' should not be used in the {B} method,
"Duplicate member ' {A} '.": "Duplicate ' {A} '",
"Expected to see a statement and instead saw a block.": "Here should be statement declaration.",
"Too many var statements.": "Excessive var declaration",
"Redefinition of ' {a} '.": "' {a} ' is defined repeatedly",
"It isn't necessary to initialize ' {a} ' to ' undefined '.": "No need to initialize ' {a} ' to ' undefined '",
"Expected a conditional expression and instead saw an assignment.": "Here you need an expression, not an assignment statement",
"Expected a ' break ' statement before ' case '": "Need to have ' break ' before ' case '.",
"Expected a ' break ' statement before ' default '.": "You need to have ' break ' before ' default '.",
"This ' switch ' should is an ' if '.": "Here ' switch ' should be ' if '.",
"All ' debugger ' statements should is removed.": "Delete ' debugger ' statement",
"' {A} ' is not a statement label.": "' {a} ' isn't a declaration label.",
"Expected an assignment or function calls and instead saw an expression.": "requires a statement or a function call, not an expression",
"Function declarations should not being placed in blocks. Use a function expression or move the statement to the top of the outer function. ":" The declaration of the functions cannot be placed in a block like if, which needs to be placed at the top of the external function. "
For some of the tips you encounter in your project, do some examples:
1 [w099]:mixed Spaces and tabs
This error is most common, meaning that in the same line, spaces and tab indents are used in a mix, and the modification is simple, usually by removing the tab indent and changing all the spaces. For convenience, we can set the tab indentation of the editor to 2 or 4 spaces instead of the original indentation.
2 [w030]:expected an assignment or function call and instead saw-an expression
This error hint is very strange, I am using the following code to prompt this error index-1 <0? index = 0:index = Index-1; This is a comma expression, but jslint that this should not be an expression and must be a function, so if you care much about the error, change it to the IF Else statement.
3 [w041]:use ' = = = ' To compare with ...
This error is that if we use congruent to replace equals, if the data types on both sides of the expression are consistent, it is recommended to use congruent to judge
4 [w033]:missing Semicolon
Missing semicolon; This is usually forgotten to write, but there is a need to note that for only one sentence of the structure, the following also need to write a semicolon. For example: if (index<0) {index=tcount-1} This code, the correct wording is if (index<0) {index=tcount-1;}, I often forget to write a semicolon here, Khan ...
There are some other error hints on the control of the change, to develop their own good code style and writing habits.
Link Source: https://www.jianshu.com/p/b02f6b15cd09
JS eslint Syntax specification error prompt code