sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

ESLint `import/no-unresolved` false positive when module is imported #251

Closed estilles closed 7 months ago

estilles commented 7 months ago

While using ESLint, a false positive is triggered when:

Example

image

Explanation

ESLint fails to detect/resolve the module because it expects the package.json main key to point to the module entry point. The existing package.json does include an exports.default key pointing to ./build/index.js, but unfortunately it is not used by ESLint.

This is obviously just a non-urgent, quality-of-life issue, but I will submit a quick PR anyway.

Workaround

Right now I'm mitigating this by having the import/no-unresolved rule ignore meow

  "rules": {
      "import/no-unresolved": ["error", { "ignore": ["meow"] }],
  }
sindresorhus commented 7 months ago

This is a problem for the import plugin to resolve. I don't plan to add a main field to package.json.