settings.json 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. "uview",
  44. "uvui",
  45. "Wechat",
  46. "WechatMiniprogram",
  47. "Weixin"
  48. ],
  49. "typescript.tsdk": "node_modules\\typescript\\lib",
  50. "explorer.fileNesting.enabled": true,
  51. "explorer.fileNesting.expand": false,
  52. "explorer.fileNesting.patterns": {
  53. "README.md": "index.html,favicon.ico,robots.txt,CHANGELOG.md",
  54. "pages.config.ts": "manifest.config.ts,openapi-ts-request.config.ts",
  55. "package.json": "tsconfig.json,pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
  56. "eslint.config.mjs": ".commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
  57. },
  58. // // 保存的时候自动格式化
  59. // "prettier.enable": true,
  60. // "editor.formatOnSave": true,
  61. // // 开启自动修复
  62. // "editor.codeActionsOnSave": {
  63. // "source.fixAll": "explicit",
  64. // "source.fixAll.eslint": "explicit",
  65. // "source.fixAll.stylelint": "explicit"
  66. // },
  67. // Disable the default formatter, use eslint instead
  68. "prettier.enable": false,
  69. "editor.formatOnSave": false,
  70. // Auto fix
  71. "editor.codeActionsOnSave": {
  72. "source.fixAll.eslint": "explicit",
  73. "source.organizeImports": "never"
  74. },
  75. // Silent the stylistic rules in you IDE, but still auto fix them
  76. "eslint.rules.customizations": [
  77. { "rule": "style/*", "severity": "off", "fixable": true },
  78. { "rule": "format/*", "severity": "off", "fixable": true },
  79. { "rule": "*-indent", "severity": "off", "fixable": true },
  80. { "rule": "*-spacing", "severity": "off", "fixable": true },
  81. { "rule": "*-spaces", "severity": "off", "fixable": true },
  82. { "rule": "*-order", "severity": "off", "fixable": true },
  83. { "rule": "*-dangle", "severity": "off", "fixable": true },
  84. { "rule": "*-newline", "severity": "off", "fixable": true },
  85. { "rule": "*quotes", "severity": "off", "fixable": true },
  86. { "rule": "*semi", "severity": "off", "fixable": true }
  87. ],
  88. // Enable eslint for all supported languages
  89. "eslint.validate": [
  90. "javascript",
  91. "javascriptreact",
  92. "typescript",
  93. "typescriptreact",
  94. "vue",
  95. "html",
  96. "markdown",
  97. "json",
  98. "json5",
  99. "jsonc",
  100. "yaml",
  101. "toml",
  102. "xml",
  103. "gql",
  104. "graphql",
  105. "astro",
  106. "svelte",
  107. "css",
  108. "less",
  109. "scss",
  110. "pcss",
  111. "postcss"
  112. ]
  113. }