You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no supported flags that would do that, only emit all or do not emit at all (--noEmit). Consider using --outDir and picking only the .d.ts files.
Scenario: Auto-Generate typings for a pure js project
Currently typings for js projects are manually hand maintained. A ton of typings are out of date with the actual code. Typings are kind of documentation and if they are separate from code, they will eventually get out of sync.
with --checkJs, JS lib authors get extra benefit of validating code with jsdoc typings. Being able to auto generate just .d.ts from their existing code would make life easier. This can be done as part of the build step.
Basically if declarations:true and noEmitJs:true, only declarations should still be generated
Useful if you only want to generate the declaration files but not compile the js. Current usage for me would be that I'm generating an Electron application. I want the d.ts files in respective directories but the js files don't need to be created because they're made during application compilation and would cause only unnecessary clutter beforehand.
Activity
mhegazy commentedon Jan 30, 2015
There is no supported flags that would do that, only emit all or do not emit at all (--noEmit). Consider using --outDir and picking only the .d.ts files.
nojvek commentedon May 17, 2017
I'm thinking of adding a --noEmitJs flag. Would you be willing to entertain that thought?
mhegazy commentedon May 17, 2017
if there is a compelling scenario.
nojvek commentedon May 17, 2017
Scenario: Auto-Generate typings for a pure js project
Currently typings for js projects are manually hand maintained. A ton of typings are out of date with the actual code. Typings are kind of documentation and if they are separate from code, they will eventually get out of sync.
with --checkJs, JS lib authors get extra benefit of validating code with jsdoc typings. Being able to auto generate just .d.ts from their existing code would make life easier. This can be done as part of the build step.
Basically if
declarations:trueandnoEmitJs:true, only declarations should still be generatedProposal:
This would just generate a single .d.ts file from the project that you can add as part of package.json. No hand maintenance.
magnus-trent commentedon Jul 17, 2017
Useful if you only want to generate the declaration files but not compile the js. Current usage for me would be that I'm generating an Electron application. I want the d.ts files in respective directories but the js files don't need to be created because they're made during application compilation and would cause only unnecessary clutter beforehand.