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

node/no-missing-import false positive on chalk v5

Open coderaiser opened this issue 3 years ago • 5 comments

Looks like the thing is chalk v5 uses export instead of main.

coderaiser avatar Jan 07 '22 15:01 coderaiser

There is the same problem with the import/no-unresolved rule (https://github.com/import-js/eslint-plugin-import/issues/2132 / https://github.com/import-js/eslint-plugin-import/issues/1810):

/home/regseb/testcase/index.js
  1:19  error  Unable to resolve path to module 'chalk'  import/no-unresolved
  1:19  error  "chalk" is not found                      node/no-missing-import

regseb avatar Mar 05 '22 16:03 regseb

Ava is also having this issue.

hildjj avatar Jan 15 '23 19:01 hildjj

This is related to this issue in resolve.

hildjj avatar Jan 15 '23 19:01 hildjj

It seems got also has this issue.

At least for me. 🤔

image

For now I will just ignore linting that import. (See below.) No biggie, for now. 😌

Part of my .eslintrc.json:

{
  "rules": {
    "import/no-unresolved": ["error", { "ignore": ["got"] }],
    "node/no-missing-import": ["error", { "allowModules": ["got"] }]
  }
}

Note that node/no-missing-import also seems to be affected ... 🤔

CvBlixen avatar Feb 04 '23 11:02 CvBlixen

eslint-plugin-n is the maintained version of this module.

We switched to it in eg. eslint-config-standard / standard and it is maintained by me and other members of the official ESLint community organization.

Try that module out and if it isn't fixed there, then open a new issue in that project.

voxpelli avatar Aug 13 '23 12:08 voxpelli