zoukankan      html  css  js  c++  java
  • vscode 保存自动 格式化eslint 代码

    在网上找了很多种方法,大多都没有成功  一下是一种成功的 配置方法:

    1) First, you need to install the ESLint extension in the VS code.

    This extension uses the ESLint library.If you haven't installed ESLint either locally or globally do so by running

    npm install eslint //For a local install
     or 
    npm install -g eslint //For a global install.
    

    2) Then, open Setting.json file in VS code. by File-> Preferences->Settings.

    3) Add following setting.

     {
        "eslint.enable": true,
        "eslint.autoFixOnSave": true,
        "eslint.run": "onType",
        "eslint.options": {
            "extensions": [".js",".vue"]
        },
        "eslint.validate": [
            { "language": "vue", "autoFix": true }
        ]
    }
    

    4) Now, check your vue file.It will start showing linting error.If not, restart the VS code.

    5) eslint --init

  • 相关阅读:
    Delphi语法
    orcad中注意的事情
    Express web框架
    Docker
    Node.JS
    再次 WebAssembly 技术探讨
    WebAssembly 浏览器中运行c/c++模块
    Http 服务 简单示例
    CentOS7 开放服务端口
    Go linux 实践4
  • 原文地址:https://www.cnblogs.com/hss-blog/p/9094661.html
Copyright © 2011-2022 走看看