Home>Article>Development Tools> eslint reports error when vscode runs vue project

eslint reports error when vscode runs vue project

王林
王林 Original
2019-11-14 15:41:52 3833browse

eslint reports error when vscode runs vue project

1. Install the plug-in eslint-plugin-vue

npm i -g eslint-plugin-vue

2. Modify the files under the project and path: .eslint.js

Add vue Options

eslint reports error when vscode runs vue project

3. Add the eslint and vetur plug-ins and download them directly in the plug-in library

eslint reports error when vscode runs vue project

4. Modify the vscode header Option configuration

[Chinese version file>Preferences>setting to find the corresponding configuration file]

[English version file>preferences>setting to find the corresponding configuration file]

[Find the configuration file and add the following code]

"eslint.autoFixOnSave": true, "eslint.validate": [ "javascript",{ "language": "vue", "autoFix": true },"html", "vue" ],

eslint reports error when vscode runs vue project

5. After the configuration is completed, restart vscode, and the eslint error will be automatically repaired when saving.

Recommended Tutorial:vscode tutorial

The above is the detailed content of eslint reports error when vscode runs vue project. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn