An ESLint plugin providing additional rules for Node.js-specific code patterns and best practices.
eslint-plugin-n is an ESLint plugin that provides additional linting rules specifically for Node.js code. It helps developers catch common Node.js-specific errors, enforce best practices, and ensure code compatibility with targeted Node.js versions. The plugin is a community-maintained fork of the original eslint-plugin-node, which is no longer actively maintained.
Node.js developers and teams who want to improve code quality, maintainability, and compatibility in their Node.js projects using ESLint for static analysis.
Developers choose eslint-plugin-n because it offers a comprehensive, actively maintained set of Node.js-specific linting rules that seamlessly integrate with ESLint. Its ability to automatically infer supported Node.js versions from project configuration and its focus on catching real-world Node.js pitfalls make it a valuable tool for ensuring robust server-side JavaScript.
Additional ESLint rules for Node.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a wide range of rules for API validation, module systems, and best practices, including detecting deprecated APIs and unsupported features based on engine versions from package.json.
As a fork of the unmaintained eslint-plugin-node, it is actively updated with clear version support tables for Node.js and ESLint, ensuring long-term viability.
Intelligently infers supported Node.js versions from the package.json engines field or ESLint settings, allowing rules to adapt dynamically to project targets.
Includes several rules with ESLint's --fix option, such as enforcing consistent export styles and adding the node: protocol to imports, reducing manual refactoring.
Contains deprecated rules like no-hide-core-modules and shebang, which can confuse users and require extra effort to avoid or migrate from.
Requires nuanced setup for mixed CommonJS and ES modules, with separate configs like flat/mixed-esm-and-cjs, adding overhead compared to simpler linting plugins.
Limited to Node.js environments, making it irrelevant for projects without Node.js code, such as pure browser-based or other runtime JavaScript applications.