博客
关于我
前端工程化:wepy配置vscode代码格式化
阅读量:304 次
发布时间:2019-03-01

本文共 984 字,大约阅读时间需要 3 分钟。

Vetur插件配置指南

安装插件Vetur是一个强大的Vue工具链插件,安装前可以通过以下步骤完成配置:

  • 打开你的项目,在终端输入以下命令安装插件:
  • npm install vetur-wepy --save-dev

    创建配置文件在你的项目根目录下,新建一个.vscode/settings.json文件,添加必要的配置内容:

    {    "editor.defaultFormatter": "hu2ren.vetur-wepy",    "vetur.validation.script": false,    "vetur.validation.interpolation": false,    "vetur.validation.template": false,    "vetur.format.defaultFormatter.js": "none",    "vetur.format.defaultFormatter.html": "js-beautify-html",    "editor.formatOnSave": true,    "eslint.run": "onSave",    "eslint.validate": ["vue"],    "editor.codeActionsOnSave": {        "source.fixAll": true,        "source.fixAll.stylelint": true    }}

    配置说明上述配置文件主要包含以下几个关键设置:

    • editor.defaultFormatter:指定代码格式化器,默认使用Vetur的formatter。
    • vetur.format.defaultFormatter.html:设置HTML文件的格式化方式。
    • editor.formatOnSave:启用格式化保存功能。
    • eslint.run:设置ESLint的运行方式。
    • editor.codeActionsOnSave:定义保存时的代码修复规则。

    结果测试在完成以上配置后,你可以按照以下步骤进行测试:

  • 保存你的HTML、CSS或JS文件
  • IDE会自动触发格式化和校验
  • 查看输出结果,确保格式正确
  • 通过以上配置,你可以在每次保存时自动校验代码格式和ESLint规则,提升开发效率。

    转载地址:http://rmpo.baihongyu.com/

    你可能感兴趣的文章
    Nio ByteBuffer组件读写指针切换原理与常用方法
    查看>>
    NIO Selector实现原理
    查看>>
    nio 中channel和buffer的基本使用
    查看>>
    NISP一级,NISP二级报考说明,零基础入门到精通,收藏这篇就够了
    查看>>
    NI笔试——大数加法
    查看>>
    NLP 基于kashgari和BERT实现中文命名实体识别(NER)
    查看>>
    NLP学习笔记:使用 Python 进行NLTK
    查看>>
    NLP:使用 SciKit Learn 的文本矢量化方法
    查看>>
    Nmap扫描教程之Nmap基础知识
    查看>>
    Nmap端口扫描工具Windows安装和命令大全(非常详细)零基础入门到精通,收藏这篇就够了
    查看>>
    NMAP网络扫描工具的安装与使用
    查看>>
    NMF(非负矩阵分解)
    查看>>
    NN&DL4.1 Deep L-layer neural network简介
    查看>>
    NN&DL4.3 Getting your matrix dimensions right
    查看>>
    NN&DL4.8 What does this have to do with the brain?
    查看>>
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
    查看>>
    No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
    查看>>
    No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
    查看>>
    No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
    查看>>