Skip to content

Enable verbatimModuleSyntax on easy-tier packages - #11479

Merged
timotheeguerin merged 2 commits into
microsoft:mainfrom
timotheeguerin:type-import-pass-1
Jul 30, 2026
Merged

Enable verbatimModuleSyntax on easy-tier packages#11479
timotheeguerin merged 2 commits into
microsoft:mainfrom
timotheeguerin:type-import-pass-1

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Summary

Incrementally rolls out TypeScript's verbatimModuleSyntax to the packages that are cheapest to migrate (the "easy tier"), converting type-only imports/re-exports to import type / export type.

This is part of a broader effort to enable verbatimModuleSyntax across the workspace. This first pass targets the 8 lowest-effort packages to prove out the workflow with minimal churn.

Packages migrated

Package Change
tmlanguage-generator flag only, no code changes
@typespec/streams flag only, no code changes
@typespec/best-practices 1 import (test)
@typespec/bundle-uploader 2 imports to import type
@typespec/spec-coverage-sdk imports + a re-export block to export type
@typespec/internal-build-utils 2 mixed imports, inline type
@typespec/library-linter import type + inline type
@typespec/bundler imports + index.ts re-exports (inline type)

Conventions followed

  • Fully type-only imports/exports use import type / export type.
  • Mixed value + type imports use the inline type modifier (matching existing usage in already-migrated packages).

Out of scope

  • tsconfig.base.json is intentionally untouched (that would force all packages at once).
  • Standalone runtime emitters (http-client-csharp, http-client-java, http-client-python).
  • Larger packages (e.g. http, openapi3, compiler) are deferred to later passes.

Validation

  • tsc -b emit build for all 8 packages
  • prettier --check on all changed files
  • oxlint on all 8 packages
  • chronus verify

Enable verbatimModuleSyntax in tsconfig.json for tmlanguage-generator,
streams, best-practices, bundle-uploader, spec-coverage-sdk,
internal-build-utils, library-linter and bundler, converting type-only
imports and re-exports to import type / export type accordingly.
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@typespec/bundler

npm i https://pkg.pr.new/@typespec/bundler@11479

@typespec/library-linter

npm i https://pkg.pr.new/@typespec/library-linter@11479

@typespec/spec-coverage-sdk

npm i https://pkg.pr.new/@typespec/spec-coverage-sdk@11479

@typespec/streams

npm i https://pkg.pr.new/@typespec/streams@11479

tmlanguage-generator

npm i https://pkg.pr.new/tmlanguage-generator@11479

commit: 6c682bc

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/bundler
  • @typespec/library-linter
  • @typespec/spec-coverage-sdk
  • @typespec/streams
  • tmlanguage-generator
Show changes

tmlanguage-generator - internal ✏️

Enable verbatimModuleSyntax in TypeScript configuration and convert type-only imports and re-exports to import type / export type accordingly.

@typespec/streams - internal ✏️

Enable verbatimModuleSyntax in TypeScript configuration and convert type-only imports and re-exports to import type / export type accordingly.

@typespec/spec-coverage-sdk - internal ✏️

Enable verbatimModuleSyntax in TypeScript configuration and convert type-only imports and re-exports to import type / export type accordingly.

@typespec/library-linter - internal ✏️

Enable verbatimModuleSyntax in TypeScript configuration and convert type-only imports and re-exports to import type / export type accordingly.

@typespec/bundler - internal ✏️

Enable verbatimModuleSyntax in TypeScript configuration and convert type-only imports and re-exports to import type / export type accordingly.

…browser bundles

verbatimModuleSyntax does not raise TS1484 for classes (which are both a
type and a value), but it stops tsc from eliding them, so class imports used
only in type positions get emitted as runtime imports. That pulled
StorageSharedKeyCredential (and other Node-only @azure/storage-blob classes)
into the website's browser bundle, which resolves @azure/storage-blob to its
browser build that does not export them. Convert those class imports to
import type so only the runtime-used BlobServiceClient is emitted.
@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin
timotheeguerin added this pull request to the merge queue Jul 30, 2026
Merged via the queue into microsoft:main with commit 4cea684 Jul 30, 2026
33 checks passed
@timotheeguerin
timotheeguerin deleted the type-import-pass-1 branch July 30, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants