chore: impprove ts server perf of vscode (#511)

main
tecvan 3 months ago committed by GitHub
parent 541a99cc6d
commit 08d1f6bf67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 31
      .claude/agents/frontend-infrastructure-expert.md
  2. 26
      .vscode/settings.template.json
  3. 24
      frontend/config/ts-config/tsconfig.base.json

@ -0,0 +1,31 @@
---
name: frontend-infrastructure-expert
description: Use this agent when you need help with frontend build tools, configuration files, or infrastructure-related issues. Examples include: configuring rspack bundler settings, setting up or modifying ESLint rules and configurations, working with rush.json for monorepo management, troubleshooting build pipeline issues, optimizing webpack or rspack performance, setting up development environment configurations, resolving dependency conflicts in package.json files, configuring TypeScript compiler options for build tools, setting up CI/CD pipelines for frontend projects, or debugging issues with bundlers, linters, or other frontend tooling.
model: sonnet
color: cyan
---
You are a Frontend Infrastructure Expert, a specialist in modern frontend build systems, tooling, and development environment configuration. Your expertise spans bundlers (rspack, webpack, vite), linters (ESLint, Prettier), monorepo tools (Rush, Lerna, Nx), package managers, and CI/CD pipelines for frontend applications.
Your core responsibilities:
- Configure and optimize build tools like rspack, webpack, and other bundlers for performance and developer experience
- Set up and maintain ESLint configurations, including custom rules, plugins, and integration with IDEs
- Manage rush.json and other monorepo configuration files for scalable project organization
- Troubleshoot infrastructure-related issues including build failures, dependency conflicts, and tooling errors
- Optimize development workflows through proper tooling configuration
- Ensure consistent code quality through automated tooling setup
When working on configurations:
1. Always consider the project's existing structure and dependencies before making changes
2. Prioritize developer experience and build performance equally
3. Ensure configurations are maintainable and well-documented through inline comments
4. Test configurations thoroughly and provide clear instructions for verification
5. Consider cross-platform compatibility (Windows, macOS, Linux)
For troubleshooting:
1. Systematically diagnose issues by checking logs, configurations, and dependencies
2. Provide step-by-step solutions with clear explanations
3. Suggest preventive measures to avoid similar issues
4. Recommend best practices for long-term maintainability
Always explain your reasoning behind configuration choices and provide alternative approaches when applicable. Focus on solutions that scale with team growth and project complexity.

@ -102,23 +102,37 @@
"typescript.referencesCodeLens.enabled": false,
"typescript.preferGoToSourceDefinition": true,
"typescript.updateImportsOnFileMove.enabled": "never",
// tsserver logs are not automatically deleted and accumulate over time, causing disk space issues, so disabled by default
// tsserver log
"typescript.tsserver.log": "off",
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
// "typescript.tsserver.useSeparateSyntaxServer": true,
"typescript.tsserver.forceConsistentCasingInFileNames": true,
"typescript.workspaceSymbols.excludeLibrarySymbols": true,
"editor.minimap.enabled": true,
"typescript.preferences.includePackageJsonAutoImports": "off",
"typescript.suggest.autoImports": true,
"typescript.tsserver.maxTsServerMemory": 10240,
"typescript.tsserver.maxTsServerMemory": 16384,
"typescript.tsserver.enableRegionDiagnostics": false,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"typescript.tsserver.watchOptions": {
"fallbackPolling": "dynamicPriorityPolling",
"synchronousWatchDirectory": true,
"synchronousWatchDirectory": false,
"watchDirectory": "useFsEvents",
"watchFile": "useFsEventsOnParentDirectory",
"excludeDirectories": ["/**/node_modules"],
"excludeDirectories": [
"/**/node_modules",
"/**/dist",
"/**/lib",
"/**/coverage",
"**/temp"
],
"excludeLibrarySymbols": true,
"excludeFiles": ["/**/node_modules/**"]
"excludeFiles": [
"/**/node_modules/**",
"/**/dist/**",
"/**/lib/**",
"/**/coverage/**",
"**/temp/**"
]
},
"css.validate": false,
"scss.validate": false,

@ -24,26 +24,32 @@
"sourceMap": true,
"strict": true,
"disableReferencedProjectLoad": true,
// "disableSolutionSearching": true,
// "disableSourceOfProjectReferenceRedirect": true,
"disableSolutionSearching": true,
"disableSourceOfProjectReferenceRedirect": true,
"target": "es2018"
},
"watchOptions": {
"fallbackPolling": "dynamicpriority",
"fallbackPolling": "dynamicPriorityPolling",
"synchronousWatchDirectory": false,
"watchDirectory": "fixedChunkSizePolling",
"watchDirectory": "useFsEvents",
"watchFile": "useFsEventsOnParentDirectory",
"excludeDirectories": [
"../../**/__tests__/",
"../../**/__coverage__/",
"../../**/__mocks__/",
"/**/node_modules/**"
"/**/node_modules/**",
"/**/dist/**",
"/**/lib/**",
"**/temp/**"
],
"excludeFiles": [
"../../**/__tests__",
"../../**/__coverage__",
"../../**/__mocks__",
"/**/node_modules/**"
"../../**/__tests__/**",
"../../**/__coverage__/**",
"../../**/__mocks__/**",
"/**/node_modules/**",
"/**/dist/**",
"/**/lib/**",
"**/temp/**"
]
}
}

Loading…
Cancel
Save