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
Swc typescript does not throw an object error in transform mode when deprecatedTsModuleAsError is true
Input code
constinputCode="module F { export type x = number }";try{transformSync(inputCode,{mode: "transform",});}catch(error){assert.strictEqual(error.code,"UnsupportedSyntax");}
Config
constDEFAULT_OPTIONS={mode: "strip-only",deprecatedTsModuleAsError: true,// default transform will only work when mode is "transform"transform: {verbatimModuleSyntax: true,nativeClassProperties: true,noEmptyExport: true,importNotUsedAsValues: "preserve",},};
Playground link (or link to the minimal reproduction)
Describe the bug
Swc typescript does not throw an object error in transform mode when
deprecatedTsModuleAsError
is trueInput code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.10.18&code=H4sIAAAAAAAAA8vNTynNSVVwU6hWSK0oyC8qUSipLEhVqFCwVcgrzU1KLVKoBQBGDE3yIwAAAA%3D%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BAWdSIifrKJVBTl7iUE0maH3xsz8jooBbNoeKq1PMsQkYX4nEsi2Sf8lARIOxTNJia49XaWvRrRCtVoOxpIyBOluiX3hoMNQajjLXPGmzH%2FC3VwkUnkCu4o%2BsnSVTc0JbjwXmrZDkk50qF%2FwA%2FqsvNjMPLqm4kXGrYvhlQioBQBAAA%3D
SWC Info output
No response
Expected behavior
it should throw an object with code "UnsupportedSyntax"
Actual behavior
No response
Version
1.10.18
Additional context
No response
The text was updated successfully, but these errors were encountered: