Skip to content

build: replace eslint-plugin-node with eslint-plugin-n (gh54 part II) - #10952

Merged
kgryte merged 16 commits into
developfrom
philipp/gh54-eslint-plugin-n
Apr 26, 2026
Merged

kgryte merged 16 commits into
developfrom
philipp/gh54-eslint-plugin-n

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Mar 15, 2026 •

Copy link
Copy Markdown
Member

Progresses stdlib-js/metr-issue-tracker#54.

Description

What is the purpose of this pull request?

This pull request:

  • Replaces the unmaintained eslint-plugin-node (v11) with its actively maintained fork eslint-plugin-n (v17) (PR 3 of the migration plan).
  • Renames plugin registration from node to n in etc/eslint/plugins/index.js.
  • Renames all rule references from node/* to n/* in etc/eslint/rules/nodejs.js.
  • Updates ~530 eslint-disable comments across the codebase from node/ to n/.
  • Drops the tryExtensions option from n/file-extension-in-import (no longer supported by eslint-plugin-n).
  • Adds ignores for features newly detected by eslint-plugin-n: bigint and hashbang in n/no-unsupported-features/es-syntax, http2 and process.release in n/no-unsupported-features/node-builtins.
  • Updates JSDoc @name tags and documentation URLs to point to the eslint-community/eslint-plugin-n repository.
  • Moves nested log/logError functions to outer scope in remark-run-javascript-examples and fixes pre-existing lint violations in touched files.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Stacked on #10950. eslint-plugin-n is the community-maintained fork of the unmaintained eslint-plugin-node and is required for ESLint v9 compatibility.

/* eslint-disable node/shebang */ were removed in various place because the new rule has different behavior:

Since eslint-plugin-n's rule selector is CallExpression > Identifier[name=/Sync$/] (and the MemberExpression variant), it only fires on call expressions whose final identifier ends in Sync. Hence property access during require calls is not flagged anymore and calling function is only flagged if the aliases actually end in Sync. This is the reason for various removed lint overrides.

If package.json was not found, this rule does nothing.

This rule checks bin field of package.json, then if a target file matches one of bin files, it checks whether or not there is a correct hashbang. Otherwise it checks whether or not there is not a hashbang.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code. The bulk rename was done via scripted sed, with manual review of config changes and rule compatibility.


@stdlib-js/reviewers

@Planeshifter
Planeshifter changed the base branch from develop to philipp/gh54-modernize-custom-rule-apis March 15, 2026 06:33
@socket-security

socket-security Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​eslint-plugin-n@​17.24.09610010087100

View full report

@Planeshifter Planeshifter changed the title bench: replace eslint-plugin-node with eslint-plugin-n build: replace eslint-plugin-node with eslint-plugin-n Mar 15, 2026
@Planeshifter
Planeshifter force-pushed the philipp/gh54-eslint-plugin-n branch 2 times, most recently from ac2468f to ff1e4ba Compare March 15, 2026 16:25
@socket-security

socket-security Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@Planeshifter Planeshifter changed the title build: replace eslint-plugin-node with eslint-plugin-n build: replace eslint-plugin-node with eslint-plugin-n (gh54 part II) Mar 15, 2026
@Planeshifter
Planeshifter force-pushed the philipp/gh54-eslint-plugin-n branch 2 times, most recently from 4fbfcbf to 7f06a75 Compare March 15, 2026 17:38
@Planeshifter Planeshifter added the METR Pull request associated with the METR project. label Mar 18, 2026
Base automatically changed from philipp/gh54-modernize-custom-rule-apis to develop March 22, 2026 06:59
@kgryte

kgryte commented Mar 22, 2026

Copy link
Copy Markdown
Member

@Planeshifter Heads-up: looks like stacking went sideways. Would you mind resolving the merge conflicts?

@kgryte

kgryte commented Mar 22, 2026

Copy link
Copy Markdown
Member

Actually, I think I know what happened. It went sideways because I had deleted the base branch on the GitHub UI. And it is not clear to me how to move this PR back against the restored base branch. :(

@kgryte

kgryte commented Mar 22, 2026

Copy link
Copy Markdown
Member

Maybe you can force push to move it back on the original base branch? 😬

@github-actions github-actions Bot mentioned this pull request Mar 22, 2026
@Planeshifter
Planeshifter force-pushed the philipp/gh54-eslint-plugin-n branch from 7f06a75 to dd197bb Compare March 23, 2026 04:20
@Planeshifter
Planeshifter marked this pull request as ready for review March 23, 2026 04:21
@Planeshifter
Planeshifter requested a review from kgryte March 23, 2026 04:21
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 23, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

No coverage information available.

@kgryte

kgryte commented Mar 26, 2026

Copy link
Copy Markdown
Member

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Mar 26, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

/stdlib merge

@kgryte, the slash command failed to complete. Please check the workflow logs for details.

View workflow run

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Mar 26, 2026
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Planeshifter requested a review from a team April 26, 2026 04:49
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 26, 2026
@Planeshifter Planeshifter removed the Needs Changes Pull request which needs changes before being merged. label Apr 26, 2026
@Planeshifter
Planeshifter requested a review from kgryte April 26, 2026 04:57
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Apr 26, 2026
Comment thread etc/eslint/rules/nodejs.js Resolved
Signed-off-by: Athan <kgryte@gmail.com>

tape( 'the plugin successfully lints valid Markdown not containing any HTML sections', opts, function test( t ) {
var fpath = join( __dirname, 'fixtures', 'valid_no_sections.md.txt' );
var file = readSync( fpath, 'utf8' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's odd that in a previous test file you had to disable the lint rule, but here you are not.

kgryte added 2 commits April 26, 2026 03:59
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread etc/eslint/rules/nodejs.js Resolved
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
kgryte previously approved these changes Apr 26, 2026
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
kgryte previously approved these changes Apr 26, 2026
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
kgryte previously approved these changes Apr 26, 2026
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte

kgryte commented Apr 26, 2026

Copy link
Copy Markdown
Member

As the CI failure is not due to changes introduced in this PR, I'll go ahead and merge.

@kgryte
kgryte merged commit 0dc62ae into develop Apr 26, 2026
10 of 14 checks passed
@kgryte
kgryte deleted the philipp/gh54-eslint-plugin-n branch April 26, 2026 12:50
@wofiporia wofiporia mentioned this pull request Sep 4, 2026
4 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

METR Pull request associated with the METR project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants