forked from mysticatea/eslint-plugin-node
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
Description
Rule details
Just like the existing rule prefer-global/console, add a rule named prefer-global/crypto.
crypto is a global variable since Node 20, but users can still import it by import crypto from 'node:crypto'.
What type of rule is this?
Suggests an alternate way of doing something
Example code
import crypto from 'node:crypto';
import crypto from 'crypto';
const crypto = require('node:crypto');
const crypto = require('crypto');These 4 lines of code should be reported when enabling prefer-global/crypto.
Participation
- I am willing to submit a pull request to implement this rule.
Additional comments
No response