ESlint plugin to change imports of builtin node modules to 'node:MODULE_NAME'
npm install eslint-plugin-prefer-node-builtin-importsESlint 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:
``sh`
npm i eslint --save-dev
Next, install eslint-plugin-prefer-node-builtin-imports:
`sh`
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:
`json`
{
"plugins": ["prefer-node-builtin-imports"]
}
Then configure the rules you want to use under the rules section.
`json``
{
"rules": {
"prefer-node-builtin-imports/prefer-node-builtin-imports": 1
}
}
TODO: Run eslint-doc-generator to generate the rules list.