Vue syntax checking tool eslint error report (error Unexpected trailing comma, Extra semicolon, error 'loadingInstance' is nev)

Vue syntax checking tool eslint error report

The syntax checking tool eslint is enabled in the development of the vue project, especially when taking over other people’s code to continue development, if you don’t pay attention to the syntax habits, there will be a bunch of warnings and errors when the project is running. .
insert image description here

1. Common errors reported by the grammar checking tool eslint:
1. "66:1 warning Expected indentation of 6 spaces but found 8 spaces"
This kind of error is a grammar indentation problem. The grammar checking tool eslint has strict calculations for the indentation spaces of each line , one more grid will result in a yellow card warning. The number in front is the location of the prompt alarm, which line and character are in the file, which is easy to locate, and every error report will have it.

2. "97:22 error Unexpected trailing comma
An extra comma appears unexpectedly at the end.
The grammar checking tool eslint also has strict restrictions on symbols. If each line of code is not required by the grammar, if the end of the comma or semicolon is added, it will be judged as redundant. Affects the operation, but will cause a red card error.
Similar to ** "Extra semicolon"** extra semicolon.

3. "117:24 error Unexpected space before function parentheses"
unexpected space appears before the function parentheses

4. "143:60 error Strings must use singlequote"
strings must use single quotes

Guess you like

Origin blog.csdn.net/start_sea/article/details/129706863