settings.json 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {
  2. // 保存时:先 TS organizeImports(合并/清理未用),再 ESLint fix(import/order + type 拆分等)
  3. "editor.codeActionsOnSave": {
  4. "source.organizeImports": "explicit",
  5. "source.fixAll.eslint": "explicit"
  6. },
  7. // 启用 ESLint flat config,并对常见 JS/TS 文件启用
  8. "eslint.useFlatConfig": true,
  9. "eslint.validate": [
  10. "javascript",
  11. "javascriptreact",
  12. "typescript",
  13. "typescriptreact"
  14. ],
  15. "eslint.run": "onType",
  16. // 自动补全 import 时优先生成 `import type`
  17. "typescript.preferences.preferTypeOnlyAutoImports": true,
  18. "typescript.tsdk": "node_modules/typescript/lib",
  19. "typescript.enablePromptUseWorkspaceTsdk": true,
  20. // 自动完成触发
  21. "editor.quickSuggestions": {
  22. "other": "on",
  23. "comments": "off",
  24. "strings": "on"
  25. },
  26. "editor.suggestOnTriggerCharacters": true,
  27. "editor.suggest.snippetsPreventQuickSuggestions": false,
  28. "editor.formatOnSave": false,
  29. "tailwindCSS.experimental.classRegex": [
  30. [
  31. "clsx\\(([^)]*)\\)",
  32. "(?:'|\"|`)([^']*)(?:'|\"|`)"
  33. ]
  34. ]
  35. }