Solve the problem of Eslint syntax error in project development

Eslint syntax error solution (vue-3)

After formatting the code during development, semicolons, single and double quotation marks, spaces, etc. are often reported as errors. It is troublesome to modify one by one. Solutions:
1. Create a root file in the root directory and use it as a formatted configuration file-- - .prettierrc
2. Fill in the configuration items

{   
	<!--在格式化文件时就不会在出现分号了;--> 
	"semi": false,
	<!-- 在格式化文件时就会变成单引号-->
	"singleQuote": true
}

3. Turn off the error report for spaces
in Eslint. Open the .eslintrc.js file and add a disabling rule to the routines. After adding it, you need to restart the project to compile

rules: {
    
    
    'space-before-function-paren':0,
    }

Guess you like

Origin blog.csdn.net/weixin_45054614/article/details/104789794