eslint-plugin-node-import

1.0.4 • Public • Published

eslint-plugin-node-import

Disallow imports of built-in Node.js modules without the node: prefix

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-node-import:

npm install eslint-plugin-node-import --save-dev

Usage

Add node-import to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
	"plugins": ["node-import"]
}

Then configure the (only) rule under the rules section.

{
	"rules": {
		"node-import/prefer-node-protocol": 2
	}
}

Rules

🔧 Automatically fixable by the --fix CLI option.

Name                 Description 🔧
prefer-node-protocol Prefer using the node: protocol when importing Node.js builtin modules. 🔧

Credits

This plugin is a composite of two different custom ESLint rules:

Licence

© 2023 Nikita Karamov
Licensed under the ISC License


This project is hosted on GitHub: https://github.com/kytta/eslint-plugin-node-import.git

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    3,319
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    3,319
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i eslint-plugin-node-import

Weekly Downloads

3,319

Version

1.0.4

License

ISC

Unpacked Size

6.34 kB

Total Files

5

Last publish

Collaborators

  • kytta