settings.json 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {
  2. // 默认格式化工具选择prettier
  3. "editor.defaultFormatter": "esbenp.prettier-vscode",
  4. // 配置stylelint检查的文件类型范围
  5. "stylelint.validate": ["css", "scss", "vue", "html"], // 与package.json的scripts对应
  6. "stylelint.enable": true,
  7. "css.validate": false,
  8. "less.validate": false,
  9. "scss.validate": false,
  10. "[shellscript]": {
  11. "editor.defaultFormatter": "foxundermoon.shell-format"
  12. },
  13. "[dotenv]": {
  14. "editor.defaultFormatter": "foxundermoon.shell-format"
  15. },
  16. "[vue]": {
  17. "editor.defaultFormatter": "esbenp.prettier-vscode"
  18. },
  19. "[typescript]": {
  20. "editor.defaultFormatter": "esbenp.prettier-vscode"
  21. },
  22. "[jsonc]": {
  23. "editor.defaultFormatter": "esbenp.prettier-vscode"
  24. },
  25. // 配置语言的文件关联
  26. "files.associations": {
  27. "pages.json": "jsonc", // pages.json 可以写注释
  28. "manifest.json": "jsonc" // manifest.json 可以写注释
  29. },
  30. "cSpell.words": [
  31. "Aplipay",
  32. "climblee",
  33. "commitlint",
  34. "dcloudio",
  35. "iconfont",
  36. "oxlint",
  37. "qrcode",
  38. "refresherrefresh",
  39. "scrolltolower",
  40. "tabbar",
  41. "Toutiao",
  42. "unibest",
  43. "uvui",
  44. "Wechat",
  45. "WechatMiniprogram",
  46. "Weixin"
  47. ],
  48. "typescript.tsdk": "node_modules\\typescript\\lib",
  49. "explorer.fileNesting.enabled": true,
  50. "explorer.fileNesting.expand": false,
  51. "explorer.fileNesting.patterns": {
  52. "README.md": "index.html,favicon.ico,robots.txt,CHANGELOG.md",
  53. "pages.config.ts": "manifest.config.ts,openapi-ts-request.config.ts",
  54. "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
  55. "eslint.config.mjs": "tsconfig.json,.commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
  56. },
  57. // 保存的时候自动格式化
  58. "prettier.enable": true,
  59. "editor.formatOnSave": true,
  60. // 开启自动修复
  61. "editor.codeActionsOnSave": {
  62. "source.fixAll": "explicit",
  63. "source.fixAll.eslint": "explicit",
  64. "source.fixAll.stylelint": "explicit"
  65. },
  66. // Disable the default formatter, use eslint instead
  67. // "prettier.enable": false,
  68. // "editor.formatOnSave": false,
  69. // Auto fix
  70. // "editor.codeActionsOnSave": {
  71. // "source.fixAll.eslint": "explicit",
  72. // "source.organizeImports": "never"
  73. // },
  74. // Silent the stylistic rules in you IDE, but still auto fix them
  75. "eslint.rules.customizations": [
  76. { "rule": "style/*", "severity": "off", "fixable": true },
  77. { "rule": "format/*", "severity": "off", "fixable": true },
  78. { "rule": "*-indent", "severity": "off", "fixable": true },
  79. { "rule": "*-spacing", "severity": "off", "fixable": true },
  80. { "rule": "*-spaces", "severity": "off", "fixable": true },
  81. { "rule": "*-order", "severity": "off", "fixable": true },
  82. { "rule": "*-dangle", "severity": "off", "fixable": true },
  83. { "rule": "*-newline", "severity": "off", "fixable": true },
  84. { "rule": "*quotes", "severity": "off", "fixable": true },
  85. { "rule": "*semi", "severity": "off", "fixable": true }
  86. ],
  87. // Enable eslint for all supported languages
  88. "eslint.validate": [
  89. "javascript",
  90. "javascriptreact",
  91. "typescript",
  92. "typescriptreact",
  93. "vue",
  94. "html",
  95. "markdown",
  96. "json",
  97. "json5",
  98. "jsonc",
  99. "yaml",
  100. "toml",
  101. "xml",
  102. "gql",
  103. "graphql",
  104. "astro",
  105. "svelte",
  106. "css",
  107. "less",
  108. "scss",
  109. "pcss",
  110. "postcss"
  111. ]
  112. }