-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rule to ensure explicit paths as required by ES Modules #2319
Comments
Handling this properly would likely require “exports” support, and native ESM support, which we (and much of the ecosystem) don’t have yet. This plugin still assumes you’re not using native ESM in node, and are transpiling with Babel or typescript. |
With ESM support maturing in Node.js I think this issue is worth revisiting. |
@wojtekmaj once However, it remains the case that ESM-only packages fail to get adoption because they aren't usable in CJS projects, and CJS-only (or dual) packages are the easiest to use and adopt, so the ecosystem has pretty clearly demonstrated it's a low priority. |
I wanted the exact same feature, so I created a small plugin: https://github.com/satazor/eslint-plugin-import-esm. Hope it helps until this plugin gets the feature requested in this issue. Please note however, it doesn’t support |
I've tried to find some way to ensure explicit paths as required by ES Modules, but couldn't find anything. To be clear, I want a rule that forces the code to use explicit extensions and indexes.
Is there a rule already for that?
The text was updated successfully, but these errors were encountered: