0
点赞
收藏
分享

微信扫一扫

VScode插件和setting.json配置文件

吴wuwu 2022-04-13 阅读 106
vscode

VScode插件和setting.json配置文件

1、VScode插件

在这里插入图片描述

2、setting.json-kui

{
  // vscode默认启用了根据文件类型自动设置tabsize的选项
  "editor.detectIndentation": false,
  // 重新设定tabsize
  "editor.tabSize": 2,
  // #每次保存的时候自动格式化
  "editor.formatOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "html",
    "vue"
  ],
  // #每次保存的时候将代码按eslint格式进行修复
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  //  #让prettier使用eslint的代码格式进行校验
  "prettier.eslintIntegration": true,
  //  #去掉代码结尾的分号
  "prettier.semi": false,
  //  #使用带引号替代双引号
  "prettier.singleQuote": true,
  //  #让函数(名)和后面的括号之间加个空格
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  // #让vue中的js按编辑器自带的ts格式进行格式化
  "vetur.format.defaultFormatter.js": "vscode-typescript",
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force-aligned"
      // #vue组件中html代码格式化样式
    }
  },
  "explorer.confirmDelete": false,
  "explorer.confirmDragAndDrop": false,
  "editor.renderControlCharacters": true,
  "editor.renderWhitespace": "all",
  "eslint.format.enable": true,
  "[typescript]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  }
}

3、setting.json-yang

{
    "editor.fontSize": 16,
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "liveServer.settings.host": "192.168.43.180",
    "editor.mouseWheelZoom": true,
    "editor.renderIndentGuides": false,
    "typescript.tsdk": "",
    // "editor.codeActionsOnSave": null,
    "launch": {
        "configurations": [],
        "compounds": []
    },
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "explorer.confirmDelete": false,
    "[json]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "workbench.iconTheme": "material-icon-theme",
    "terminal.integrated.tabs.enabled": false,
    "easysass.formats": [
        {
            "format": "expanded",
            "extension": ".css"
        },
        {
            "format": "compressed",
            "extension": ".min.css"
        }
    ],
    "gitlens.codeLens.scopes": [
        "document",
        "containers",
        "blocks"
    ],
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 240,
            "wrap_attributes": "auto",
            "end_with_newline": false
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "typescript.locale": "zh-CN",
    // #每次保存的时候将代码按eslint格式进行修复
    "eslint.autoFixOnSave": true,
    "eslint.options": {
        "configFile": "./.eslintrc.js",
        "extensions": [
            "html",
            ".js",
            ".vue"
        ]
    },
    "eslint.validate": [
        "javascript",
        // 添加 vue 支持
        {
            "language": "vue",
            "autoFix": true
        },
        // 添加 html 支持
        {
            "language": "html",
            "autoFix": true
        }
    ],
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "editor.unicodeHighlight.invisibleCharacters": false,
    "git.confirmSync": false,
}{
    "editor.fontSize": 16,
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "liveServer.settings.host": "192.168.43.180",
    "editor.mouseWheelZoom": true,
    "editor.renderIndentGuides": false,
    "typescript.tsdk": "",
    // "editor.codeActionsOnSave": null,
    "launch": {
        "configurations": [],
        "compounds": []
    },
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "explorer.confirmDelete": false,
    "[json]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "workbench.iconTheme": "material-icon-theme",
    "terminal.integrated.tabs.enabled": false,
    "easysass.formats": [
        {
            "format": "expanded",
            "extension": ".css"
        },
        {
            "format": "compressed",
            "extension": ".min.css"
        }
    ],
    "gitlens.codeLens.scopes": [
        "document",
        "containers",
        "blocks"
    ],
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 240,
            "wrap_attributes": "auto",
            "end_with_newline": false
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "typescript.locale": "zh-CN",
    // #每次保存的时候将代码按eslint格式进行修复
    "eslint.autoFixOnSave": true,
    "eslint.options": {
        "configFile": "./.eslintrc.js",
        "extensions": [
            "html",
            ".js",
            ".vue"
        ]
    },
    "eslint.validate": [
        "javascript",
        // 添加 vue 支持
        {
            "language": "vue",
            "autoFix": true
        },
        // 添加 html 支持
        {
            "language": "html",
            "autoFix": true
        }
    ],
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "editor.unicodeHighlight.invisibleCharacters": false,
    "git.confirmSync": false,
}
举报

相关推荐

0 条评论