Rule proposal: `prefer-node-protocol`
See original GitHub issueNode.js has added node:
support for builtin modules https://nodejs.org/api/esm.html#esm_node_imports, I think add it is more clear that module is builtin.
Fail
import fs from 'fs';
export {promises as default} from 'fs'
async function foo() {
const fs = await import('fs');
// ...
}
Pass
import fs from 'node:fs';
export {promises as default} from 'node:fs'
async function foo() {
const fs = await import('node:fs');
// ...
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (2 by maintainers)
Top Results From Across the Web
eslint-plugin-unicorn/prefer-node-protocol.md at main - GitHub
Prefer using the node: protocol when importing Node.js builtin modules. This rule is enabled in the ✓ recommended config. This rule is automatically ......
Read more >Assigning Pods to Nodes - Kubernetes
You can indicate that a rule is soft or preferred, so that the scheduler still schedules the Pod even if it can't find...
Read more >Coinbase petition for SEC rulemaking
Commission rules that govern the offer, sale, trading, custody, and clearing ... Coinbase, like many other exchanges, has intentionally and.
Read more >Paxos - Martin Fowler
In the first phase (called prepare phase), the node proposing a value (called a proposer) contacts all the nodes in the cluster (called ......
Read more >R1403 Procedure 5 Plans - AQMD
Procedure 5 Plans are required to clean-up any disturbed Asbestos Containing Materials, ... To obtain Procedure 5 Plan approval, use the Rule 1403...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This rule just broke my build. I think this should not be fixed by default with the recommended configuration. This is a quite new feature, that is not widely know and that may break the build if the environment is not prepared to handle node protocol imports.
Don’t worry, I can work on it.