Skip to content
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

Change import/extensions #31

Open
brettz9 opened this issue Jun 23, 2021 · 3 comments
Open

Change import/extensions #31

brettz9 opened this issue Jun 23, 2021 · 3 comments

Comments

@brettz9
Copy link
Contributor

brettz9 commented Jun 23, 2021

I would recommending changing import/extensions to "always" and adding ignorePackages: true.

Extensions are required in native ESM both in the browser and in Node (see https://nodejs.org/api/esm.html#esm_mandatory_file_extensions ). In the case of the browser, some packages wish to import without a build step, e.g., so as to import in a demo and be able to do rapid development.

However, I suggest the ignorePackages: true option because it seems that though one can whitelist use of ".js" for an explicit path per https://nodejs.org/api/packages.html#packages_package_entry_points , I see no way to use wildcards to support extensions--they seem to only support lack of extensions, at least for nested wildcard paths. But this is only for packages; relative/absolute paths as mentioned above need to have the extension.

@gajus
Copy link
Owner

gajus commented Nov 9, 2021

This is the likely path forward after TypeScript releases ESM module compatibility.

@gajus
Copy link
Owner

gajus commented Apr 9, 2022

This will be added once 4.7 comes out

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/

@kurtextrem
Copy link

@gajus TS 5 is out by now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants