Skip to content

feat: add eslint-plugin-n/node - #541

Open
aladdin-add with Copilot wants to merge 8 commits into
masterfrom
copilot/change-request-re-export-namespace-node
Open

feat: add eslint-plugin-n/node#541
aladdin-add with Copilot wants to merge 8 commits into
masterfrom
copilot/change-request-re-export-namespace-node

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown

This pull request introduces a new eslint-plugin-n/node entry point to help users migrating from eslint-plugin-node maintain the familiar node/ 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:

  • Added a new lib/node-entry.js file that creates a plugin export with all rules and configs renamed from the n/ prefix to the node/ prefix, and ensures plugin references are updated accordingly. This allows users to continue using the node/ prefix for rules when migrating from eslint-plugin-node.
  • Updated package.json to add an export for the new ./node entry point, making it available for import as eslint-plugin-n/node.

Documentation:

  • Updated README.md to document the new eslint-plugin-n/node entry point and provide a usage example for users migrating from eslint-plugin-node.

Testing:

  • Added tests/lib/node-entry.js to 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.

Copilot AI changed the title [WIP] Change namespace 'node' for eslint-plugin-n feat: re-export plugin using node namespace Jun 19, 2026
Copilot AI requested a review from aladdin-add June 19, 2026 11:19
Copilot AI changed the title feat: re-export plugin using node namespace docs: add .eslintrc.json usage example to README Jun 20, 2026
Comment thread README.md Outdated
])
```

### **[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)** (An example)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot You should use "eslint-plugin-n/node" here, not .eslintrc.json.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI requested a review from aladdin-add August 7, 2026 05:20
@aladdin-add
aladdin-add marked this pull request as ready for review August 7, 2026 05:40
Copilot AI lite review requested due to automatic review settings August 7, 2026 05:40
@aladdin-add aladdin-add changed the title docs: add .eslintrc.json usage example to README feat: add eslint-plugin-n/node Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 remaps n/* rule keys and plugin namespace usage to node/*.
  • Exposed the new entry point via package.json exports and added a new test file for the wrapper behavior.
  • Updated README.md to document eslint-plugin-n/node usage.

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 thread tests/lib/node-entry.js Outdated
Comment thread lib/node-entry.js
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 thread README.md
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants