You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Versions which don't resolve typings in typesVersions will fail to pick up typings, which is a better error than random syntax errors in various places.
Tools can also use the typesVersions entries to make decisions; for example, my recent codemod work of moving to import type syntax could special case packages that support < TS 3.9 if this information were programmatically accessible from the package definition.
Alternative solution:
Use typesVersions to redirect older versions to unsupported.d.ts. This will work most of the time, and maybe require less modifications in the future. This will work with TypeScript 3.1 and newer, but for older versions than that it won't be respected while the suggested solution should work for very very old versions.
The text was updated successfully, but these errors were encountered:
Problem:
Customer uses TypeScript 3.7 with Fluent UI and starts getting syntax errors because TypeScript doesn't recognize newer syntaxes in d.ts files.
Proposed solution (one of many possibly):
In package.json for each package, specify
types
asunsupported.d.ts
. Additionally usetypesVersions
entry to specify the minbar TypeScript version:See documentation here: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions
Versions which don't resolve typings in
typesVersions
will fail to pick up typings, which is a better error than random syntax errors in various places.Tools can also use the
typesVersions
entries to make decisions; for example, my recent codemod work of moving toimport type
syntax could special case packages that support < TS 3.9 if this information were programmatically accessible from the package definition.Alternative solution:
Use
typesVersions
to redirect older versions tounsupported.d.ts
. This will work most of the time, and maybe require less modifications in the future. This will work with TypeScript 3.1 and newer, but for older versions than that it won't be respected while the suggested solution should work for very very old versions.The text was updated successfully, but these errors were encountered: