eslint-plugin-node icon indicating copy to clipboard operation
eslint-plugin-node copied to clipboard

`no-missing-imports` does not support "exports" in package.json

Open giltayar opened this issue 5 years ago • 3 comments

When checking for existence of an import, the new "exports" field is not checked.

Example:

If package foo has this package.json:

{
   "exports": {
      "./bar": "./src/bar.js"
   }
}

Then importing it (or requiring it) via

import "foo/bar"

yields a no-missing-import error, when in fact it works (Node >= 12.x).

giltayar avatar Feb 10 '21 07:02 giltayar

There can be also imports field in package.json which can be used for mappings.

"imports": {
    "#abc/*": "./abc/out/*"
}
import x from '#abc/file'

david-bojnansky avatar Nov 17 '21 06:11 david-bojnansky

Any progress on this? The missing support of "exports" e.g. creates a false positive when using got for fetching web resources.

BePo65 avatar Feb 14 '22 06:02 BePo65

This is implemented in a fork of this package: https://github.com/weiran-zsd/eslint-plugin-node/pull/4. Mysticatea has not been seen for quite a while (which is OK!) so a few people decided to fork and continue developing in the fork.

giltayar avatar Feb 14 '22 16:02 giltayar