Skip to content

tsc interprets glob patterns wrong #50807

@its-dibo

Description

@its-dibo

Bug Report

I try to run tsc against a set of files using glob patterns, but it seems that tsc interprets it wrongly.
for example this cmd tsc config/**/*.{m,}js --declaration should be interprets as all .mjs and .js files in the specified path
but tsc treats it as a single file with the extension .{m,}js.
this give me the error File 'config/**/*.{m,}js' has an unsupported extension. The only supported extensions are ...

I also tried .{mjs,js} and {.mjs,js}

the actual full command:

npx -p typescript tsc config/**/*{.mjs,js} --declaration --allowJs --emitDeclarationOnly --esModuleInterop

🔎 Search Terms

  • tsc glob patterns
  • tsc cli options
  • tsc FAQ

🕗 Version & Regression Information

I use npx so the latest version is used

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions