settings.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {
  2. "files.eol": "\n",
  3. "eslint.workingDirectories": [{ "mode": "auto" }],
  4. "[typescript]": {
  5. "editor.defaultFormatter": "biomejs.biome"
  6. },
  7. "[javascript]": {
  8. "editor.defaultFormatter": "biomejs.biome"
  9. },
  10. // use vscode-stylelint
  11. // see https://github.com/stylelint/vscode-stylelint
  12. "stylelint.validate": ["css", "less", "scss"],
  13. "stylelint.ignoreDisables": true,
  14. "css.validate": false,
  15. "less.validate": false,
  16. "scss.validate": false,
  17. "editor.codeActionsOnSave": {
  18. "source.fixAll.eslint": "explicit",
  19. "source.fixAll.biome": "explicit",
  20. "source.organizeImports.biome": "explicit",
  21. "source.fixAll.markdownlint": "explicit",
  22. "source.fixAll.stylelint": "explicit"
  23. },
  24. "editor.formatOnSave": true,
  25. "githubPullRequests.ignoredPullRequestBranches": [
  26. "master"
  27. ],
  28. "typescript.tsdk": "node_modules/typescript/lib",
  29. "typescript.enablePromptUseWorkspaceTsdk": true,
  30. "typescript.preferences.autoImportFileExcludePatterns": ["node_modules/*"],
  31. "typescript.validate.enable": true,
  32. "typescript.surveys.enabled": false,
  33. "vitest.filesWatcherInclude": "**/*",
  34. "mcp": {
  35. "servers": {
  36. "fetch": {
  37. "command": "uvx",
  38. "args": ["mcp-server-fetch"]
  39. },
  40. "context7": {
  41. "type": "http",
  42. "url": "https://mcp.context7.com/mcp"
  43. }
  44. }
  45. },
  46. "github.copilot.chat.codeGeneration.instructions": [
  47. {
  48. "text": "Always write inline comments in source code in English."
  49. }
  50. ],
  51. "github.copilot.chat.testGeneration.instructions": [
  52. {
  53. "text": "Basis: Use vitest as the test framework"
  54. },
  55. {
  56. "text": "Basis: The vitest configuration file is `apps/app/vitest.workspace.mts`"
  57. },
  58. {
  59. "text": "Basis: Place test modules in the same directory as the module being tested. For example, if testing `mymodule.ts`, place `mymodule.spec.ts` in the same directory as `mymodule.ts`"
  60. },
  61. {
  62. "text": "Basis: Use the VSCode Vitest extension for running tests. Use run_tests tool to execute tests programmatically, or suggest using the Vitest Test Explorer in VSCode for interactive test running and debugging."
  63. },
  64. {
  65. "text": "Basis: Fallback command for terminal execution: `cd /growi/apps/app && pnpm vitest run {test file path}`"
  66. },
  67. {
  68. "text": "Step 1: When creating new test modules, start with small files. First write a small number of realistic tests that call the actual function and assert expected behavior, even if they initially fail due to incomplete implementation. Example: `const result = foo(); expect(result).toBeNull();` rather than `expect(true).toBe(false);`. Then fix the implementation to make tests pass."
  69. },
  70. {
  71. "text": "Step 2: Write essential tests. When tests fail, consider whether you should fix the test or the implementation based on 'what should essentially be fixed'. If you're not confident in your reasoning, ask the user for guidance."
  72. },
  73. {
  74. "text": "Step 3: After writing tests, make sure they pass before moving on. Do not proceed to write tests for module B without first ensuring that tests for module A are passing"
  75. },
  76. {
  77. "text": "Tips: Don't worry about lint errors - fix them after tests are passing"
  78. },
  79. {
  80. "text": "Tips: DO NOT USE `as any` casting. You can use vitest-mock-extended for type-safe mocking. Import `mock` from 'vitest-mock-extended' and use `mock<InterfaceType>()`. This provides full TypeScript safety and IntelliSense support."
  81. },
  82. {
  83. "text": "Tips: Mock external dependencies at the module level using vi.mock(). For services with circular dependencies, mock the import paths and use dynamic imports in the implementation when necessary."
  84. }
  85. ],
  86. "github.copilot.chat.commitMessageGeneration.instructions": [
  87. {
  88. "text": "Always write commit messages in English."
  89. }
  90. ]
  91. }