Home > Development Tools > VSCode > body text

eslint reports error when vscode runs vue project

王林
Release: 2019-11-14 15:41:52
Original
3944 people have browsed it

eslint reports error when vscode runs vue project

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

npm i -g eslint-plugin-vue
Copy after login

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"
],
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template