Enable verbatimModuleSyntax for eng scripts - #5135
Merged
Merged
Conversation
This was referenced Jul 31, 2026
This was referenced Jul 31, 2026
Contributor
|
No changes needing a change description found. |
Contributor
|
You can try these changes here
|
timotheeguerin
marked this pull request as ready for review
July 31, 2026 21:45
timotheeguerin
enabled auto-merge
July 31, 2026 21:56
xirzec
approved these changes
Jul 31, 2026
chidozieononiwu
pushed a commit
to chidozieononiwu/typespec-azure
that referenced
this pull request
Aug 1, 2026
…5132) Type-only imports in `typespec-azure` are still emitted as runtime imports. That leaves dead runtime edges in the emitted JS, makes module side effects ambiguous, and blocks ever turning `verbatimModuleSyntax` on repo-wide — something `core` has already been rolling out package by package. This enables the flag for **`typespec-client-generator-core`** and rewrites the imports it flags: ```diff -import { SdkContext } from "./interfaces.js"; +import type { SdkContext } from "./interfaces.js"; ``` The rewrite was driven by the compiler rather than by regex: build the program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics, and change exactly the specifiers TypeScript names — hoisting to `import type` when every specifier in a clause is type-only, otherwise adding an inline `type` modifier. `tsc` then reports zero new errors against a pre-change baseline, so no value binding was turned into a type-only one. One of a series of PRs, one per package, so each diff stays reviewable. They are independent and can land in any order. | PR | Scope | | --- | --- | | Azure#5127 | `samples`, `typespec-python`, `benchmark`, `typespec-azure-playground-website`, `typespec-metadata`, `spector-runner` | | Azure#5128 | `azure-http-specs` | | Azure#5129 | `typespec-autorest` | | Azure#5130 | `typespec-azure-core` | | Azure#5131 | `typespec-azure-resource-manager` | | Azure#5132 | `typespec-client-generator-core` | | Azure#5133 | `typespec-go` | | Azure#5134 | `typespec-ts` | | Azure#5135 | `eng/` scripts | `typespec-autorest-canonical`, `typespec-azure-portal-core` and `typespec-azure-rulesets` already had the flag. `typespec-java` is deliberately left out: its `src/` is copied in at build time from `azure-sdk-for-java`, so the flag would break its build until those sources are migrated upstream. Once these land, a follow-up will hoist the flag into a repo-level `tsconfig.base.json` and drop the per-package copies, so new packages inherit it by default.
chidozieononiwu
pushed a commit
to chidozieononiwu/typespec-azure
that referenced
this pull request
Aug 1, 2026
…#5131) Type-only imports in `typespec-azure` are still emitted as runtime imports. That leaves dead runtime edges in the emitted JS, makes module side effects ambiguous, and blocks ever turning `verbatimModuleSyntax` on repo-wide — something `core` has already been rolling out package by package. This enables the flag for **`typespec-azure-resource-manager`** and rewrites the imports it flags: ```diff -import { SdkContext } from "./interfaces.js"; +import type { SdkContext } from "./interfaces.js"; ``` The rewrite was driven by the compiler rather than by regex: build the program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics, and change exactly the specifiers TypeScript names — hoisting to `import type` when every specifier in a clause is type-only, otherwise adding an inline `type` modifier. `tsc` then reports zero new errors against a pre-change baseline, so no value binding was turned into a type-only one. One of a series of PRs, one per package, so each diff stays reviewable. They are independent and can land in any order. | PR | Scope | | --- | --- | | Azure#5127 | `samples`, `typespec-python`, `benchmark`, `typespec-azure-playground-website`, `typespec-metadata`, `spector-runner` | | Azure#5128 | `azure-http-specs` | | Azure#5129 | `typespec-autorest` | | Azure#5130 | `typespec-azure-core` | | Azure#5131 | `typespec-azure-resource-manager` | | Azure#5132 | `typespec-client-generator-core` | | Azure#5133 | `typespec-go` | | Azure#5134 | `typespec-ts` | | Azure#5135 | `eng/` scripts | `typespec-autorest-canonical`, `typespec-azure-portal-core` and `typespec-azure-rulesets` already had the flag. `typespec-java` is deliberately left out: its `src/` is copied in at build time from `azure-sdk-for-java`, so the flag would break its build until those sources are migrated upstream. Once these land, a follow-up will hoist the flag into a repo-level `tsconfig.base.json` and drop the per-package copies, so new packages inherit it by default.
chidozieononiwu
pushed a commit
to chidozieononiwu/typespec-azure
that referenced
this pull request
Aug 1, 2026
Type-only imports in `typespec-azure` are still emitted as runtime
imports. That leaves dead runtime edges in the emitted JS, makes module
side effects ambiguous, and blocks ever turning `verbatimModuleSyntax`
on repo-wide — something `core` has already been rolling out package by
package.
This enables the flag for **`typespec-autorest`** and rewrites the
imports it flags:
```diff
-import { SdkContext } from "./interfaces.js";
+import type { SdkContext } from "./interfaces.js";
```
The rewrite was driven by the compiler rather than by regex: build the
program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics,
and change exactly the specifiers TypeScript names — hoisting to `import
type` when every specifier in a clause is type-only, otherwise adding an
inline `type` modifier. `tsc` then reports zero new errors against a
pre-change baseline, so no value binding was turned into a type-only
one.
One of a series of PRs, one per package, so each diff stays reviewable.
They are independent and can land in any order.
| PR | Scope |
| --- | --- |
| Azure#5127 | `samples`, `typespec-python`, `benchmark`,
`typespec-azure-playground-website`, `typespec-metadata`,
`spector-runner` |
| Azure#5128 | `azure-http-specs` |
| Azure#5129 | `typespec-autorest` |
| Azure#5130 | `typespec-azure-core` |
| Azure#5131 | `typespec-azure-resource-manager` |
| Azure#5132 | `typespec-client-generator-core` |
| Azure#5133 | `typespec-go` |
| Azure#5134 | `typespec-ts` |
| Azure#5135 | `eng/` scripts |
`typespec-autorest-canonical`, `typespec-azure-portal-core` and
`typespec-azure-rulesets` already had the flag. `typespec-java` is
deliberately left out: its `src/` is copied in at build time from
`azure-sdk-for-java`, so the flag would break its build until those
sources are migrated upstream.
Once these land, a follow-up will hoist the flag into a repo-level
`tsconfig.base.json` and drop the per-package copies, so new packages
inherit it by default.
chidozieononiwu
pushed a commit
to chidozieononiwu/typespec-azure
that referenced
this pull request
Aug 1, 2026
Type-only imports in `typespec-azure` are still emitted as runtime
imports. That leaves dead runtime edges in the emitted JS, makes module
side effects ambiguous, and blocks ever turning `verbatimModuleSyntax`
on repo-wide — something `core` has already been rolling out package by
package.
This enables the flag for **`samples`, `typespec-python`, `benchmark`,
`typespec-azure-playground-website`, `typespec-metadata` and
`spector-runner`** and rewrites the imports it flags:
```diff
-import { SdkContext } from "./interfaces.js";
+import type { SdkContext } from "./interfaces.js";
```
The rewrite was driven by the compiler rather than by regex: build the
program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics,
and change exactly the specifiers TypeScript names — hoisting to `import
type` when every specifier in a clause is type-only, otherwise adding an
inline `type` modifier. `tsc` then reports zero new errors against a
pre-change baseline, so no value binding was turned into a type-only
one.
One of a series of PRs, one per package, so each diff stays reviewable.
They are independent and can land in any order.
| PR | Scope |
| --- | --- |
| Azure#5127 | `samples`, `typespec-python`, `benchmark`,
`typespec-azure-playground-website`, `typespec-metadata`,
`spector-runner` |
| Azure#5128 | `azure-http-specs` |
| Azure#5129 | `typespec-autorest` |
| Azure#5130 | `typespec-azure-core` |
| Azure#5131 | `typespec-azure-resource-manager` |
| Azure#5132 | `typespec-client-generator-core` |
| Azure#5133 | `typespec-go` |
| Azure#5134 | `typespec-ts` |
| Azure#5135 | `eng/` scripts |
`typespec-autorest-canonical`, `typespec-azure-portal-core` and
`typespec-azure-rulesets` already had the flag. `typespec-java` is
deliberately left out: its `src/` is copied in at build time from
`azure-sdk-for-java`, so the flag would break its build until those
sources are migrated upstream.
Once these land, a follow-up will hoist the flag into a repo-level
`tsconfig.base.json` and drop the per-package copies, so new packages
inherit it by default.
chidozieononiwu
pushed a commit
to chidozieononiwu/typespec-azure
that referenced
this pull request
Aug 1, 2026
Type-only imports in `typespec-azure` are still emitted as runtime
imports. That leaves dead runtime edges in the emitted JS, makes module
side effects ambiguous, and blocks ever turning `verbatimModuleSyntax`
on repo-wide — something `core` has already been rolling out package by
package.
This enables the flag for **`typespec-azure-core`** and rewrites the
imports it flags:
```diff
-import { SdkContext } from "./interfaces.js";
+import type { SdkContext } from "./interfaces.js";
```
The rewrite was driven by the compiler rather than by regex: build the
program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics,
and change exactly the specifiers TypeScript names — hoisting to `import
type` when every specifier in a clause is type-only, otherwise adding an
inline `type` modifier. `tsc` then reports zero new errors against a
pre-change baseline, so no value binding was turned into a type-only
one.
One of a series of PRs, one per package, so each diff stays reviewable.
They are independent and can land in any order.
| PR | Scope |
| --- | --- |
| Azure#5127 | `samples`, `typespec-python`, `benchmark`,
`typespec-azure-playground-website`, `typespec-metadata`,
`spector-runner` |
| Azure#5128 | `azure-http-specs` |
| Azure#5129 | `typespec-autorest` |
| Azure#5130 | `typespec-azure-core` |
| Azure#5131 | `typespec-azure-resource-manager` |
| Azure#5132 | `typespec-client-generator-core` |
| Azure#5133 | `typespec-go` |
| Azure#5134 | `typespec-ts` |
| Azure#5135 | `eng/` scripts |
`typespec-autorest-canonical`, `typespec-azure-portal-core` and
`typespec-azure-rulesets` already had the flag. `typespec-java` is
deliberately left out: its `src/` is copied in at build time from
`azure-sdk-for-java`, so the flag would break its build until those
sources are migrated upstream.
Once these land, a follow-up will hoist the flag into a repo-level
`tsconfig.base.json` and drop the per-package copies, so new packages
inherit it by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type-only imports in
typespec-azureare still emitted as runtime imports. That leaves dead runtime edges in the emitted JS, makes module side effects ambiguous, and blocks ever turningverbatimModuleSyntaxon repo-wide — somethingcorehas already been rolling out package by package.This enables the flag for the
eng/scripts (tsconfig.eng.json) and rewrites the imports it flags:The rewrite was driven by the compiler rather than by regex: build the program with the flag on, collect the TS1484/TS1485/TS1205 diagnostics, and change exactly the specifiers TypeScript names — hoisting to
import typewhen every specifier in a clause is type-only, otherwise adding an inlinetypemodifier.tscthen reports zero new errors against a pre-change baseline, so no value binding was turned into a type-only one.One of a series of PRs, one per package, so each diff stays reviewable. They are independent and can land in any order.
samples,typespec-python,benchmark,typespec-azure-playground-website,typespec-metadata,spector-runnerazure-http-specstypespec-autoresttypespec-azure-coretypespec-azure-resource-managertypespec-client-generator-coretypespec-gotypespec-tseng/scriptstypespec-autorest-canonical,typespec-azure-portal-coreandtypespec-azure-rulesetsalready had the flag.typespec-javais deliberately left out: itssrc/is copied in at build time fromazure-sdk-for-java, so the flag would break its build until those sources are migrated upstream.Once these land, a follow-up will hoist the flag into a repo-level
tsconfig.base.jsonand drop the per-package copies, so new packages inherit it by default.