ESlint plugin to change imports of builtin node modules to 'node:MODULE_NAME' This is a minimalistic (without additional dependencies) implemenation of eslint-plugin-unicorn-prefer-node-protocol-rule. It uses the same test cases as the unicorn version.
Shoutout to @alex-kinokon and @sindresorhus for inspiration.
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-prefer-node-builtin-imports
:
npm install eslint-plugin-prefer-node-builtin-imports --save-dev
Add prefer-node-builtin-imports
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["prefer-node-builtin-imports"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"prefer-node-builtin-imports/prefer-node-builtin-imports": 1
}
}
TODO: Run eslint-doc-generator to generate the rules list.