Note: This issue was written with the help of translation tools. I apologize if there are any unnatural expressions.
Description
In the Test Projects documentation, the config file naming pattern is described as:
matches (vite|vitest).*.config.* pattern
This notation is ambiguous — users may interpret * as a shell glob (any character), but the actual implementation uses \w+ (regex word characters: [a-zA-Z0-9_]):
const CONFIG_REGEXP = /^vite(?:st)?(?:\.\w+)?\.config\./
This means names like vitest.my-project.config.ts silently fail to be detected, which can be confusing.
Suggested Change
Make the pattern description more explicit. For example:
- Show the actual regex or clarify that only word characters (
a-z, A-Z, 0-9, _) are allowed
- Add an "invalid" example (e.g.
vitest.my-project.config.ts) alongside the valid ones
Additional context
Description
In the Test Projects documentation, the config file naming pattern is described as:
This notation is ambiguous — users may interpret
*as a shell glob (any character), but the actual implementation uses\w+(regex word characters:[a-zA-Z0-9_]):This means names like
vitest.my-project.config.tssilently fail to be detected, which can be confusing.Suggested Change
Make the pattern description more explicit. For example:
a-z,A-Z,0-9,_) are allowedvitest.my-project.config.ts) alongside the valid onesAdditional context
packages/vitest/src/node/projects/resolveProjects.ts#L25