博客
关于我
前端工程化: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/

    你可能感兴趣的文章
    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 module named cv2
    查看>>
    No module named tensorboard.main在安装tensorboardX的时候遇到的问题
    查看>>
    No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
    查看>>
    No new migrations found. Your system is up-to-date.
    查看>>
    No qualifying bean of type XXX found for dependency XXX.
    查看>>
    No resource identifier found for attribute 'srcCompat' in package的解决办法
    查看>>
    No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
    查看>>
    NO.23 ZenTaoPHP目录结构
    查看>>
    NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
    查看>>
    Node JS: < 一> 初识Node JS
    查看>>
    Node-RED中使用JSON数据建立web网站
    查看>>
    Node-RED中使用node-red-browser-utils节点实现选择Windows操作系统中的文件并实现图片预览
    查看>>
    Node-RED中实现HTML表单提交和获取提交的内容
    查看>>
    Node.js 实现类似于.php,.jsp的服务器页面技术,自动路由
    查看>>
    node.js 怎么新建一个站点端口
    查看>>
    Node.js 文件系统的各种用法和常见场景
    查看>>
    node.js 配置首页打开页面
    查看>>
    node.js+react写的一个登录注册 demo测试
    查看>>