首页 > 技术文章 > vscode中怎样格式化js代码

cbugs 2021-09-10 15:01 原文

一、安装插件: Pretty Formatter

  Windows上的Visual Studio代码 - Shift+ Alt+F

二、关闭文件自动化保存

菜单文件 → 首选项 → 工作区设置

{ // Controls if the editor should automatically format the line after typing

    "beautify.onSave": true,

    "editor.formatOnSave": true,

    // You can auto format any files based on the file extensions type.

    "beautify.JSfiles": [

        "js",

        "json",

        "jsbeautifyrc",

        "jshintrc",

        "ts"

    ]
}

  

 

推荐阅读