Enable verbatimModuleSyntax on easy-tier packages - #11479
Conversation
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.
@typespec/bundler
@typespec/library-linter
@typespec/spec-coverage-sdk
@typespec/streams
tmlanguage-generator
commit: |
|
All changed packages have been documented.
Show changes
|
…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.
|
You can try these changes here
|
Summary
Incrementally rolls out TypeScript's
verbatimModuleSyntaxto the packages that are cheapest to migrate (the "easy tier"), converting type-only imports/re-exports toimport type/export type.This is part of a broader effort to enable
verbatimModuleSyntaxacross the workspace. This first pass targets the 8 lowest-effort packages to prove out the workflow with minimal churn.Packages migrated
tmlanguage-generator@typespec/streams@typespec/best-practices@typespec/bundle-uploaderimport type@typespec/spec-coverage-sdkexport type@typespec/internal-build-utilstype@typespec/library-linterimport type+ inlinetype@typespec/bundlerindex.tsre-exports (inlinetype)Conventions followed
import type/export type.typemodifier (matching existing usage in already-migrated packages).Out of scope
tsconfig.base.jsonis intentionally untouched (that would force all packages at once).http-client-csharp,http-client-java,http-client-python).http,openapi3,compiler) are deferred to later passes.Validation
tsc -bemit build for all 8 packagesprettier --checkon all changed filesoxlinton all 8 packageschronus verify