Skip to content

emitDeclarationOnly with listEmittedFiles prints no generated files #27009

Closed
@raffaellod

Description

@raffaellod

Search Terms:
emitDeclarationOnly

Code

$ mkdir /tmp/tstest1
$ cd /tmp/tstest1
$ npm install 'typescript@next'
npm WARN saveError ENOENT: no such file or directory, open '/tmp/tstest1/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/tmp/tstest1/package.json'
npm WARN tstest1 No description
npm WARN tstest1 No repository field.
npm WARN tstest1 No README data
npm WARN tstest1 No license field.

+ typescript@3.1.0-dev.20180907
added 1 package in 1.358s
$ touch index.ts
$ node_modules/.bin/tsc --listEmittedFiles index.ts
TSFILE: /tmp/tstest1/index.js
$ node_modules/.bin/tsc --listEmittedFiles --declaration index.ts
TSFILE: /tmp/tstest1/index.js
TSFILE: /tmp/tstest1/index.d.ts
$ rm index.d.ts index.js
$ node_modules/.bin/tsc --listEmittedFiles --declaration --emitDeclarationOnly index.ts
$ ls index.*
index.d.ts  index.ts

Expected behavior:
listEmittedFiles with declaration and emitDeclarationOnly prints the generated .d.ts files, just like it does with just declaration.

Actual behavior:
listEmittedFiles with declaration and emitDeclarationOnly prints no generated files. The .d.ts files are actually generated, just like without emitDeclarationOnly.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions