Skip to content

fix: support hyphens in config file name pattern #9739

@Koutaro-Hanabusa

Description

@Koutaro-Hanabusa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions