mysticatea / eslint-plugin-node

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

[no-missing-import/-require] Support `node:` URL scheme #275

Closed valtlai closed 3 years ago

valtlai commented 3 years ago

The node/no-missing-import and node/no-missing-require rules don’t support the node: URL scheme, so there’s a false positive in cases like the following:

import fs from 'node:fs';

// or

const fs = require('node:fs');

Currently, the rules conflict with unicorn/prefer-node-protocol.

crystalfp commented 3 years ago

also node/no-missing-import does not accept import fs from "node:fs"

valtlai commented 3 years ago

I actually meant no-missing-import/-require and not no-extraneous-import/-require. Updated the title and comment.