Vue uses commands to solve ESLint warnings in batches

Reprinted at https://www.pianshen.com/article/78541223088/

After using eslint in vue, if the code is not standardized, many warning errors will be reported, and a red underline will also be prompted. Change one by one, and the workload is too large. This is a headache. Let’s talk about how to solve these in batches. Error warning caused by irregular eslint code The
steps are as follows:
1. Open package.json, find
it in script, insert picture description here
Amend as above

Modify lint to: (insert –fix in the middle) “lint”: “eslint --fix --ext .js,.vue src test/unit”,
2. Run npm run lint on the terminal to modify the code style

3. In the end, running npm run dev on the terminal will not report ESLint warnings. But there may be one or two warnings, don't panic, hold on. Find the source according to the warning prompt, solve the warning, so that hundreds of warnings are removed.

Guess you like

Origin blog.csdn.net/weixin_49295874/article/details/112603760