Open privatenumber opened 3 years ago
Happy to open a PR if feature request is approved
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";
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.
Given the following export map.
Related https://github.com/mysticatea/eslint-plugin-node/issues/255