zoukankan      html  css  js  c++  java
  • vscode格式化配置

    安装插件

    1. ESlint
    2. vutur
    3. vscode-icons
    4. Bracket Pair Colorizer
    5. Beautify
    6. Document This
      1 2 5必须装

    新的

    { //背景主题
    "workbench.iconTheme": "vscode-icons",
    //背景主题
    "workbench.colorTheme": "One Dark Pro",
    // tab 大小为2个空格
    "editor.tabSize": 2,
    // 100 列后换行
    "editor.wordWrapColumn": 100,
    // 保存时格式化
    "editor.formatOnSave": true,
    // 开启 vscode 文件路径导航
    "breadcrumbs.enabled": true,
    // prettier 设置语句末尾不加分号
    "prettier.semi": false,
    // prettier 设置强制单引号
    "prettier.singleQuote": true,
    // 选择 vue 文件中 template 的格式化工具
    "vetur.format.defaultFormatter.html": "prettyhtml",
    // 显示 markdown 中英文切换时产生的特殊字符
    "editor.renderControlCharacters": true,
    // 设置 eslint 保存时自动修复
    "eslint.autoFixOnSave": true,
    // eslint 检测文件类型
    "eslint.validate": [
    "vue",
    "html",
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
    ],
    // vetur 的自定义设置
    "vetur.format.defaultFormatterOptions": {
    "prettier": {
    "singleQuote": true,
    "semi": false
    }
    },
    // vue 扩展的文件默认使用 prettier 进行格式化
    "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
    },
    "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
    }
    }

    旧的

    setting.json

    // vscode默认启用了根据文件类型自动设置tabsize的选项 
    "editor.detectIndentation": false,
    // 重新设定tabsize
    "editor.tabSize": 4,
    // #每次保存的时候自动格式化 
    "editor.formatOnSave": true,
    // #每次保存的时候将代码按eslint格式进行修复
    "eslint.autoFixOnSave": true,
    // #去掉代码结尾的分号 
    "prettier.semi": false,
    // #使用带引号替代双引号 
    "prettier.singleQuote": true,
    // #让函数(名)和后面的括号之间加个空格
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    // #这个按用户自身习惯选择 
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    // #让vue中的js按编辑器自带的ts格式进行格式化 
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    // "vetur.format.defaultFormatterOptions": {
    //     "js-beautify-html": {
    //         "wrap_line_length": 120,
    //         "wrap_attributes": "auto"
    //         // #vue组件中html代码格式化样式
    //     }
    // },
    // 格式化stylus, 需安装Manta's Stylus Supremacy插件
    "stylusSupremacy.insertColons": false, // 是否插入冒号
    "stylusSupremacy.insertSemicolons": false, // 是否插入分号
    "stylusSupremacy.insertBraces": false, // 是否插入大括号
    "stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
    "stylusSupremacy.insertNewLineAroundBlocks": false,
    "explorer.confirmDelete": false, // 两个选择器中是否换行
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "workbench.iconTheme": "vscode-icons",
    "files.autoSave": "off",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "diffEditor.ignoreTrimWhitespace": false,
    "window.zoomLevel": 0,
    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "guides.enabled": false,
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
  • 相关阅读:
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    mac flutter 创建过程及遇到的问题
    MAC 终端编辑完成后如何保存:
    mac下添加环境变量
    beanstalkd队列
    小程序真机上报错 for developer: some selectors are not allowed in component wxss , including tag name selectors, id selectors, and attribute selectors
    小程序通过web-view实现与h5页面之间的交互
    小程序中的web-view与h5网页之间的交互
  • 原文地址:https://www.cnblogs.com/fanwenyan/p/14492712.html
Copyright © 2011-2022 走看看