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

Allow noEmit and composite together in 3.7 #33809

Closed
Volox opened this issue Oct 4, 2019 · 13 comments · Fixed by #33883
Closed

Allow noEmit and composite together in 3.7 #33809

Volox opened this issue Oct 4, 2019 · 13 comments · Fixed by #33883
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@Volox
Copy link

Volox commented Oct 4, 2019

TypeScript Version: 3.7.0-beta

Search Terms: composite noEmit monorepo

Expected behavior:

In 3.6 I was able to compile with those 2 options enabled now in 3.7 beta I cannot do that anymore.

Actual behavior:

error TS5053: Option 'noEmit' cannot be specified with option 'composite'.

Related Issues: No?

@Volox Volox changed the title Allow noEmit and composite together Allow noEmit and composite together in 3.7 Oct 4, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Oct 7, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.7.1 milestone Oct 7, 2019
@RyanCavanaugh
Copy link
Member

@sheetalkamat this breaks vstsc for projects with composite because the task adds noEmit to the commandline

@amcasey
Copy link
Member

amcasey commented Oct 7, 2019

As part of it's incremental compilation, VS runs a pass with --listEmittedFiles --listFiles --noEmit. cc @uniqueiniquity

@sheetalkamat
Copy link
Member

interesting.. Technically with --noEmit shouldn't listEmittedFiles be empty list?

@sheetalkamat sheetalkamat added the Fix Available A PR has been opened for this issue label Oct 8, 2019
@amcasey
Copy link
Member

amcasey commented Oct 8, 2019

@sheetalkamat, I would think so too, but @uniqueiniquity or @PranavSenthilnathan would know more about why it's there.

@uniqueiniquity
Copy link
Contributor

It should - I don't think --listEmittedFiles necessarily needs to be part of that pass.

@yacinehmito
Copy link
Contributor

The issue seems to be back in 3.8.2.

@weswigham
Copy link
Member

weswigham commented Feb 21, 2020

The revert was reverted again in #36483 because, per #32882, it really doesn't make sense to have incremental and noEmit together, since noEmit prevents us from writing incremental metadata. (So nothing is actually incremental).

You should consider emitDeclarationOnly instead of noEmit, if you actually just want incremental checking.

@yacinehmito
Copy link
Contributor

Thank you. It makes sense.

@yacinehmito
Copy link
Contributor

For other readers: the parameter to use is emitDeclarationOnly (declaration is singular).

@milesj
Copy link

milesj commented Mar 10, 2020

I'm still not sold on this. I used noEmit within our tests folder, because we don't want test files being compiled, nor generating declaration files. Now this pattern isn't possible without using a ton of gitignore patterns.

It also breaks other tooling like ESLint as these built files are now being pulled in, so we must configure rules against this also.

@yacinehmito
Copy link
Contributor

I am in the exact same situation as you are; I was using noEmit with incremental on test files. However the point is that you're not actually benefiting from incremental if you are not emitting declaration files.

Now this pattern isn't possible without using a ton of gitignore patterns. (...) It also breaks other tooling like ESLint as these built files are now being pulled in (...)

I wonder about the specifics of your project. For ours, all build artifacts are in a build/ folder. It is ignored by both git and ESLint. When setting emitDeclarationOnly for test files, I didn't have to change anything as the declaration files were emitting alongside the normal code.
The only thing I have to add is something to delete these declaration files when publishing.

@milesj
Copy link

milesj commented Mar 10, 2020

This isn't the project, but a similar setup: https://github.com/airbnb/lunar/blob/master/packages/core/test/tsconfig.json Each test folder has its own tsconfig.json, separate from the package itself, since it has different requirements.

Now that incremental emits files, it's converting our test files to js, like foo.test.ts -> foo.test.js, which resulted in ESLint running against all of these new js files (and failing a ton). I got around this with emitDeclarationOnly: true, and gitignoring the d.ts files, but it still feels super ugly.

@weswigham
Copy link
Member

I got around this with emitDeclarationOnly: true, and gitignoring the d.ts files, but it still feels super ugly.

You can also use the declarationDir option to dump the declaration files in a cache directory that's easier to ignore, if you'd prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants