Please, direct me what should I write in .eslintrc
in my situation.
https://github.com/nodejs/node/issues/38343
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
If I deny this rule I got error:
import path from "path"; // ESLint: Prefer `node:path` over `path`.(unicorn/prefer-node-protocol)
Else I got this error:
import path from "node:path"; // ESLint: Unable to resolve path to module 'node:path'.(import/no-unresolved)
I want to use both of rules. But I can't imagine what to write down for linter to understand that node:path
is just about the same as path
.
Node environment is enabled for this file:
"env": {
"node": true
}
node -v -> v14.16.1
Currently you need node 16 to use the "node:" prefix.
Support will be backported to node 14 and 12 but (at the time of writing this) these backports haven't been released yet.
Node 14.18.0 should include the backport (looking at this commit).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With