mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
958 stars 167 forks source link

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

Open coderaiser opened 2 years ago

coderaiser commented 2 years ago

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

regseb commented 2 years ago

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
hildjj commented 1 year ago

Ava is also having this issue.

hildjj commented 1 year ago

This is related to this issue in resolve.

CvBlixen commented 1 year ago

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 ... 🤔

voxpelli commented 10 months ago

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.