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

verbatimModuleSyntax = true switches incremental compilation to isolatedModules = true #53374

Closed
uasan opened this issue Mar 20, 2023 · 6 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@uasan
Copy link

uasan commented Mar 20, 2023

Hello, the new option verbatimModuleSyntax has a very simple and clear description, but nothing is said here about how this option affects incremental compilation.

compilerOptions = {
  incremental: true,
  isolatedModules: false,
  verbatimModuleSyntax: true,
}

When this option is enabled, when changing a file on which other files depend (they import this file), these dependent files are not added to the set of changed files, the same effect will be if you enable the isolatedModules = true option.

I wanted to know if this is intended behavior or a bug?
Not including dependent files in the set of changed files breaks some logic in our builder.

@fatcerberus
Copy link

isolatedModules: false, verbatimModuleSyntax: true is not a valid combination - the latter implies the former. In fact this set of options should produce an error to the effect that both of those options can't be specified at the same time.

@uasan
Copy link
Author

uasan commented Mar 20, 2023

Ok, then you need to give an error with this combination of settings

@fatcerberus
Copy link

fatcerberus commented Mar 20, 2023

Ok, then you need to give an error with this combination of settings

Like I said, it already should be doing that now.

TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'

@uasan
Copy link
Author

uasan commented Mar 20, 2023

unfortunately in version TS 5.0.2 i don't get this error

@fatcerberus
Copy link

Huh. Guess there is a bug, then, just not the one you thought it was 😄

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Mar 21, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 21, 2023
@JoshuaKGoldberg
Copy link
Contributor

Err, I get this locally with TS 5.0.2?

$ cat tsconfig.json
{
  "compilerOptions": {
    "incremental": true,
    "isolatedModules": true,
    "verbatimModuleSyntax": true
  }
}
$ tsc --version
Version 5.0.2
$ tsc
tsconfig.json:4:5 - error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.

4     "isolatedModules": true,
      ~~~~~~~~~~~~~~~~~


Found 1 error in tsconfig.json:4

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

No branches or pull requests

4 participants