Vscode

配置 eslint 自动修复

{
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": "explicit"
    },
    "vetur.experimental.templateInterpolationService": true, // 使 vue template 支持 ts
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "[json]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode",
    },
    "json.validate.enable": false,
    "json.schemaDownload.enable": false
}

Mac 快捷键

F12 / cmd + 鼠标单击  # 转到定义
ctrl -               # 返回上一层

Windows 快捷键

F12 / ctrl + 鼠标单击 # 转到定义
alt 左箭头            # 返回上一层

国际化插件 i18n Ally 配置

{
  "i18n-ally.localesPaths": ["app/public/langs"],
  "i18n-ally.extract.autoDetect": true,
  "i18n-ally.sourceLanguage": "zh-CN",
  "i18n-ally.displayLanguage": "zh-CN",
  "i18n-ally.sortKeys": false,
  "i18n-ally.enabledParsers": ["ts", "json"],
  "i18n-ally.enabledFrameworks": ["vue", "vue-sfc"],
  "i18n-ally.keystyle": "nested",
  "i18n-ally.ignoreFiles": ["**/config.json"],
}

自动生成文件描述信息 koroFIleHeader 配置

{
    "fileheader.customMade": {
        "Description": ""
    },
    "fileheader.cursorMode": {
        "description": "",
        "param": "",
        "return": ""
    },
    "fileheader.configObj": {
        "autoAdd": false,
        "createHeader": true,
        "prohibitAutoAdd": ["json", "md", "d.ts"],
        "folderBlacklist": [
            "coverage",
            "__test__",
            "node_modules",
            "tsconfig.ts",
            "vite.config.ts"
        ]
    }
}

常用插件

  • Conventional Commits : 约束提交规范
  • GitLens : git 支持
  • i18n Ally : 国际化插件
  • Vue - Official : vue 文件
  • EditorConfig for VS Code : 格式化文档
  • ESLint
  • Prettier
  • Code Runner : 运行代码片段,运行 ts 需要全局安装 ts-node
  • markdownlint : md 文件格式化
  • Markdown Preview Enhanced : md 文件预览
  • WSL : vscode 直连本机 wsl
  • GraphQL Language Feature Support : GraphQL 支持
  • koroFIleHeader : 用于自动生成文件描述
  • TODO Highlight : 高亮 TODO: