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 to define the used .d.ts files in the tsconfig.json #2865

Closed
egamma opened this issue Apr 22, 2015 · 6 comments
Closed

Support to define the used .d.ts files in the tsconfig.json #2865

egamma opened this issue Apr 22, 2015 · 6 comments
Labels
Duplicate An existing issue was already created

Comments

@egamma
Copy link
Member

egamma commented Apr 22, 2015

I would be nice to support that I can define which library .d.ts are used for my project in the tsconfig.json file. In this way I do not have to add /// refs in all the files in the project.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

Why not just use the "files" property in the tsconfig.json file?

{
    "compilerOptions" : {
         "target" : " ES5"
    },
    "files" : [
         "file1.ts",
         "typeings\\lib1.d.ts",
         "typeings\\lib2.d.ts"
    ]
}

@egamma
Copy link
Member Author

egamma commented Apr 22, 2015

Good , but then I have to enumerate all the .ts files. I thought there was globbing support, but I don't see this mentioned anymore in the wiki https://github.com/Microsoft/TypeScript/wiki/tsconfig.json.

Is there still globbing support?

@johnpapa
Copy link

tldr; Wow, we need this to support glob patterns.

Here is my use case ... I have a project with a few 100 files in TS and several 3rd party libraries with a concatenated lib.d.ts file. I want intellisense everywhere with the least amount of friction.

Option 1) Add /// reference to every file to point to the lib.d.ts and leave the tsconfig's file array undefined so it reads all of my app TS. Downside ... every file has this extra line ... yuk (100's of places)

Option 2) Add a gulp task that creates the files array in the tsconfig.json with the 3rd party lib.d.ts and my .ts files (lots of them). Downside, a gulp task to keep up, but at least my code is untouched

Option 3) Add glob support to tsconfig's files array so I can do this

files: ['lib.d.ts', '**/*.ts`]

I vote for option 3. So much easier and less friction for devs.

@egamma
Copy link
Member Author

egamma commented Apr 22, 2015

Actually the mankala sample from https://github.com/Microsoft/TypeScriptSamples includes a filesGlob attribute. Is this officially supported?

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "noLib": false
    },
    "filesGlob": [
        "./**/*.ts",
        "!./node_modules/**/*.ts"
    ],
    "files": [
        ".d.ts"
    ]
}

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

the additional "filesGlob" is supported by some tools like atom-typescript plugin, but not by the compiler. adding glob support to tsconfig is tracked by #1927

@johnpapa
Copy link

ok, moving my points over there

@mhegazy mhegazy added the Duplicate An existing issue was already created label May 28, 2015
@mhegazy mhegazy closed this as completed May 28, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants