order rule should support "node:" protocol for imports
See original GitHub issueThe order
rule should support the node:
protocol for builtin node modules.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:29 (19 by maintainers)
Top Results From Across the Web
order rule should support "node:" protocol for imports #2035
The order rule wants me to import nedb before node:fs because, with the node: protocol, it alphabetically precedes it. However, I want the...
Read more >New in Node.js: `node:` protocol imports - 2ality
Node.js now supports a node: protocol for built-in modules. The new node: protocol #. Previously: import * as fs from 'fs/promises';. Now:
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
An import statement can reference an ES module or a CommonJS module. import statements are permitted only in ES modules, but dynamic import()...
Read more >Getting Started with (and Surviving) Node.js ESM
The above rules just hold within a single package or application. Going across a package boundary (e.g., importing a dependency) can make Node....
Read more >import - JavaScript - MDN Web Docs - Mozilla
In order to use the import declaration in a source file, the file must be interpreted by the runtime as a module. In...
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 Free
Top 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
What downsides ? If you talk about node compatibility, it is only important for library developers, not for application developers.
For advantages, there are some explained in this proposal https://github.com/nodejs/node/issues/38343 which is about to use it by default in node documentation examples.
So if you disagree, I suggest you to give your counter arguments to the Node.js team before it is done (for now there are almost only positive reactions).
@ljharb fyi: This is indeed fixed in
v2.23.0