【vscode】本地配置和根据不同项目不同的vscode配置

目录

    • 1. .vscode项目配置
    • 2. vscode本地配置

1. .vscode项目配置

{
  "typescript.tsdk": "node_modules/typescript/lib",
  "prettier.enable": false,
  "god.tsconfig": "./tsconfig.json",
  // TODO: 文件默认配置
  "[css]": {},
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[less]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
      "source.fixAll.stylelint": true
    }
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

  // eslint,stylelint自动修复
  "eslint.run": "onType",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
  },

  // 保存自动格式化
  "editor.formatOnSave": true,

  // 启动stylelint
  "stylelint.enable": true,
  "stylelint.validate": ["css", "less", "vue", "html"],
  "i18n-ally.localesPaths": ["src/locales"],
  "i18n-ally.keystyle": "nested",
  "i18n-ally.sortKeys": true,
  "i18n-ally.namespace": false,
  "i18n-ally.enabledParsers": ["ts"],
  "i18n-ally.sourceLanguage": "en",
  "i18n-ally.displayLanguage": "zh-CN",
  "i18n-ally.enabledFrameworks": ["vue", "react"],
  "volar.inlayHints.eventArgumentInInlineHandlers": false
}

2. vscode本地配置

{
  "workbench.iconTheme": "vscode-icons",
  "editor.wordWrap": "on",
  "editor.lineHeight": 0,
  "editor.fontWeight": "normal",
  "editor.fontFamily": "'Fira Code'",//后边的引号中写上要设置的字体类型,个人比较喜欢Fira Code

  "editor.fontLigatures": true, //设置是否多字符连体
  "html.format.wrapAttributes": "aligned-multiple",
  "files.eol": "\n",
  //保存的时候自动格式化, 这句话一定不能加上,不然和prettier冲突
  // "editor.formatOnSave": true, // TODO:自有项目打开,其他项目关闭
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[css]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  // "eslint.format.enable": true,
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/target": true,
    "**/logs": true
  },
  // "vetur.format.defaultFormatterOptions": {
  //   "prettier": {
  //       "printWidth": 160,
  //       "singleQuote": true, // 使用单引号
  //       "semi": true, // 末尾使用分号
  //       "tabWidth": 4,
  //       "arrowParens": "avoid",
  //       "bracketSpacing": true,
  //       "proseWrap": "preserve" // 代码超出是否要换行 preserve保留
  //   }
  // },
  "files.exclude": {
    // "**/node_modules": true,
    // "**/package-lock.json": true
  },
  "editor.minimap.enabled": true,
  "files.associations": {
    "*.wxss": "css",
    "*.wxml": "wxml",
    "*.cjson": "jsonc",
    "*.wxs": "javascript",
    "*.json": "jsonc",
    "*.xtpl": "html",
    "*.tsx": "typescript"
  },
  "emmet.includeLanguages": {
    "wxml": "html"
  },
  "minapp-vscode.disableAutoConfig": true,
  "workbench.startupEditor": "newUntitledFile",
"git.autofetch": false,
  "editor.accessibilityPageSize": 12,
  "sync.gist": "68836bf9f631400aea55045d66621ec6",
  "emmet.triggerExpansionOnTab": true,
  "todo-tree.tree.showScanModeButton": false,
  "cSpell.userWords": ["hhserp"],
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "todo-tree.general.tags": [
    "BUG",
    "HACK",
    "FIXME",
    "TODO",
    "XXX",
    "[ ]",
    "[x]"
  ],
  "todo-tree.regex.regex": "(//|#|
                    

你可能感兴趣的:(#,【插件系列】,vscode,ide,编辑器)