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

feat: file-extension-in-import to consider exports map #258

Open
privatenumber opened this issue Mar 3, 2021 · 2 comments
Open

feat: file-extension-in-import to consider exports map #258

privatenumber opened this issue Mar 3, 2021 · 2 comments

Comments

@privatenumber
Copy link

When importing an extension-less path, I'd like for file-extension-in-import to check if the path exists in the target package's exports map. If it exists, it should not error.

eg.

import * as assert from 'uvu/assert';

Given the following export map.


Related #255

@privatenumber
Copy link
Author

privatenumber commented Mar 3, 2021

Happy to open a PR if feature request is approved

@jaydenseric
Copy link

This issue should be labeled a bug, not an enhancement. The node/file-extension-in-import rule is straight-up broken, reporting false errors that are impossible to fix without using // eslint-disable-next-line node/file-extension-in-import. The package exports field is not some optional, exotic feature. It's core functionality for all the current stable Node.js versions (claimed to be supported by eslint-plugin-node) and in use by all sorts of popular packages.

Here is a situation I run into a lot:

// eslint-disable-next-line node/file-extension-in-import
import { red } from "kleur/colors";

brettz9 pushed a commit to brettz9/eslint-plugin-node that referenced this issue Jul 24, 2024
feat: node builtins

Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com>
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