import-js / import-js/eslint-plugin-import

enforce-node-protocol-usage conflicts with no-unresolved

Open
#3,199 3 comments 5 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I have enabled the [`import/enforce-node-protocol-usage`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/enforce-node-protocol-usage.md) rule as mentioned in [this comment](https://github.com/import-js/eslint-plugin-import/issues/3193#issuecomment-3005628582). After running ESLint, I am encountering the following error of [`import/no-unresolved`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md):

```text
error Unable to resolve path to module 'node:fs' import/no-unresolved
```

Is this a bug, or is there a configuration step I need to follow to resolve node protocol module imports when using this rule?

Any guidance on how to fix this would be appreciated.

Contributor guide

Open the contributing guide

Research direction

Start with the documented import/enforce-node-protocol-usage and import/no-unresolved rules linked in the issue, then reproduce the reported node:fs error with both rules enabled. Done means node protocol imports are handled without an incorrect no-unresolved error, or the required configuration is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.