-
Notifications
You must be signed in to change notification settings - Fork 12.8k
allowArbitraryExtensions
does not work as expected
#55507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You're missing the |
doesn't it mean any errors about this file with unknown extension would be suppressed ?
…________________________________
发件人: Martin Johns ***@***.***>
发送时间: Friday, August 25, 2023 4:23:17 PM
收件人: microsoft/TypeScript ***@***.***>
抄送: indooorsman ***@***.***>; Author ***@***.***>
主题: Re: [microsoft/TypeScript] `allowArbitraryExtensions` does not work as expected (Issue #55507)
You're missing the app.d.css.ts file.
―
Reply to this email directly, view it on GitHub<#55507 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABFRA3O73WC455ZKZLSNL2TXXBOHLANCNFSM6AAAAAA355TP4M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Not sure where you got that idea. #51435, where this was implemented:
You still need types for the file you’re importing, as with any other import. The flag just prevents the import from failing on the basis of the file extension alone. |
Got it, thanks for the explanation
…________________________________
发件人: Bruce Pascoe ***@***.***>
发送时间: Friday, August 25, 2023 9:07:30 PM
收件人: microsoft/TypeScript ***@***.***>
抄送: indooorsman ***@***.***>; Author ***@***.***>
主题: Re: [microsoft/TypeScript] `allowArbitraryExtensions` does not work as expected (Issue #55507)
Not sure where you got that idea.
#51435<#51435>, where this was implemented:
Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths
And, correspondingly, the .d.ext.ts files needed to describe the shape of whatever it is [you’re] importing.
You still need types for the file you’re importing, as with any other import. The flag just prevents the import from failing on the basis of the file extension alone.
―
Reply to this email directly, view it on GitHub<#55507 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABFRA3MEKW2N4XEXGAZFMALXXCPRFANCNFSM6AAAAAA355TP4M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
🔎 Search Terms
allowArbitraryExtensions
🕗 Version & Regression Information
⏯ Playground Link
https://codesandbox.io/p/sandbox/typescript-playground-export-forked-mfz7rg?file=/index.ts:10,28
💻 Code
my tsconfig.json
🙁 Actual behavior
I have set
allowArbitraryExtensions
to true, but it still throw error when import a.css
file.As mentioned in document:
🙂 Expected behavior
should not throw error
Additional information about the issue
The text was updated successfully, but these errors were encountered: