feat: add eslint-plugin-n/node - #541
Open
aladdin-add with Copilot wants to merge 8 commits into
Open
Conversation
Copilot
AI
changed the title
[WIP] Change namespace 'node' for eslint-plugin-n
feat: re-export plugin using Jun 19, 2026
node namespace
Copilot
AI
changed the title
feat: re-export plugin using
docs: add Jun 20, 2026
node namespace.eslintrc.json usage example to README
aladdin-add
reviewed
Aug 7, 2026
| ]) | ||
| ``` | ||
|
|
||
| ### **[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)** (An example) |
There was a problem hiding this comment.
@copilot You should use "eslint-plugin-n/node" here, not .eslintrc.json.
Author
There was a problem hiding this comment.
I've replaced the .eslintrc.json example with an example showing how to use the eslint-plugin-n/node entry point in eslint.config.js.
Commit: 6079192
aladdin-add
marked this pull request as ready for review
August 7, 2026 05:40
.eslintrc.json usage example to READMEThere was a problem hiding this comment.
Pull request overview
This PR introduces a new eslint-plugin-n/node entry point intended to support a node/ rule prefix (primarily for users migrating from eslint-plugin-node), and documents its usage in the README.
Changes:
- Added
lib/node-entry.js, a wrapper export that remapsn/*rule keys and plugin namespace usage tonode/*. - Exposed the new entry point via
package.jsonexportsand added a new test file for the wrapper behavior. - Updated
README.mdto documenteslint-plugin-n/nodeusage.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/node-entry.js |
Adds a wrapper plugin export that rewrites config/plugin/rule namespaces to node/. |
package.json |
Adds an exports map to expose the new ./node entry point. |
tests/lib/node-entry.js |
Adds tests asserting the wrapper’s exported meta, rules, and config rule renaming behavior. |
README.md |
Documents how to use the new eslint-plugin-n/node entry point in eslint.config.js. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+34
to
+51
| const configs = {} | ||
|
|
||
| for (const configName in plugin.configs) { | ||
| const config = plugin.configs[configName] | ||
| if (Array.isArray(config)) { | ||
| configs[configName] = config.map(c => ({ | ||
| ...c, | ||
| plugins: mapPlugins(c.plugins), | ||
| rules: renameRules(c.rules), | ||
| })) | ||
| } else { | ||
| configs[configName] = { | ||
| ...config, | ||
| plugins: mapPlugins(config.plugins), | ||
| rules: renameRules(config.rules), | ||
| } | ||
| } | ||
| } |
Comment on lines
+60
to
+63
| ### `eslint-plugin-n/node` | ||
|
|
||
| If you are migrating from `eslint-plugin-node` and want to keep the `node/` prefix for rules, you can use the `eslint-plugin-n/node` entry point: | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
eslint-plugin-n/nodeentry point to help users migrating fromeslint-plugin-nodemaintain the familiarnode/rule prefix. The changes include the implementation of the new entry point, updates to documentation, and the addition of tests to ensure correct behavior.Node entry point implementation and configuration:
lib/node-entry.jsfile that creates a plugin export with all rules and configs renamed from then/prefix to thenode/prefix, and ensures plugin references are updated accordingly. This allows users to continue using thenode/prefix for rules when migrating fromeslint-plugin-node.package.jsonto add an export for the new./nodeentry point, making it available for import aseslint-plugin-n/node.Documentation:
README.mdto document the neweslint-plugin-n/nodeentry point and provide a usage example for users migrating fromeslint-plugin-node.Testing:
tests/lib/node-entry.jsto verify that the new entry point exports the correct meta and rules, renames rules and plugin prefixes as expected, handles array configs, and does not mutate the original plugin configs.