Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for wildcards in command line #911

Open
prabirshrestha opened this issue Oct 17, 2014 · 8 comments
Open

Support for wildcards in command line #911

prabirshrestha opened this issue Oct 17, 2014 · 8 comments
Labels
Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@prabirshrestha
Copy link
Member

It would be great if we could have wildcard support for files.

tsc -w -m amd -t es5 **/*.ts

Currently we need to use unix commands.

find . -name "*.ts" | xargs tsc -w -m amd -t es5

There are also cases when we would like to have wildcards for multiple different folders

tsc -w -m amd -t es5 _generated/**/*.ts Typescript/**/*.ts
@danquirk danquirk added Suggestion An idea for TypeScript Help Wanted You can do this labels Oct 17, 2014
am11 added a commit to am11/TypeScript that referenced this issue Oct 18, 2014
am11 added a commit to am11/TypeScript that referenced this issue Nov 2, 2014
@prabirshrestha
Copy link
Member Author

Also seems like tsconfig.json doesn't support wildcards.

@danquirk
Copy link
Member

danquirk commented May 7, 2015

Correct, tsconfig doesn't currently support wildcards or globs. There are bugs already tracking the suggestion for that.

@mhegazy
Copy link
Contributor

mhegazy commented Feb 20, 2016

related to glob support in tsconfig: #1927

@NaridaL
Copy link
Contributor

NaridaL commented Sep 20, 2017

How would one go about creating a test for this? I've found https://github.com/Microsoft/TypeScript/blob/master/tests/cases/unittests/matchFiles.ts, would something similar be applicable or is that too low-level?

@mhegazy
Copy link
Contributor

mhegazy commented Sep 25, 2017

I do not think this file is used any more. looks like it was left there as a result of a bad merge. we should remove it.

The unit tests are under src/harness. the one closest is https://github.com/Microsoft/TypeScript/blob/master/src/harness/unittests/commandLineParsing.ts

that said, i think the importance of this issue is fairly low now. users have been using tsconfig.json, and we have not heard about this issue in over 2.5 years. so i would not spend much time on it. i think you can get better bang for your buck looking at other more recent issues.

@mhegazy mhegazy added this to the Community milestone Jan 4, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@R3dXIII
Copy link

R3dXIII commented Oct 15, 2019

When I run tsc command I get file not found when using wildcards:
C:\Websites\hello-world>tsc *.ts && node main.js
error TS6053: File '*.ts' not found. Found 1 error.

@0x1026
Copy link

0x1026 commented Dec 26, 2022

Entering 2023, and we're exactly like 2014, amazing

@cawoodm
Copy link

cawoodm commented Oct 23, 2023

I find it hard to believe that tsc doesn't support wildcards. But it doesn't. Why do I have to tell it which individual files to compile?

Works Fine with individual files

tsc src/tmp.js --noEmit --checkJs
src/tmp.js:15:14 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

15   return add('a', 2);
                ~~~

Will not compile all files

tsc src/*.js --noEmit --checkJs
error TS6053: File 'src/*.js' not found.
  The file is in the program because:
    Root file specified for compilation


Found 1 error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

8 participants