Skip to content

chore: migrate to package.json-based linting package management - #2576

Merged
MikeMcC399 merged 3 commits into
nodejs:mainfrom
MikeMcC399:migrate/linting-npm-package
Jul 30, 2026
Merged

chore: migrate to package.json-based linting package management#2576
MikeMcC399 merged 3 commits into
nodejs:mainfrom
MikeMcC399:migrate/linting-npm-package

Conversation

@MikeMcC399

Copy link
Copy Markdown
Contributor

Description

Move version definition of npm packages to package.json & package-lock.json:

  • doctoc
  • markdown-link-check
  • prettier

Use Node.js 24 (Active LTS).

Update linting workflows to run based on above package definitions:

Workflow
doctoc.yml
markdown-link-check.yml
prettier.yml

workflow_dispatch: event triggers are added to make it easier to check linting issue before submitting a PR.

Enable weekly npm updating through Dependabot.

Update CONTRIBUTING with prerequisites and linting instructions. Add Table of Contents.

Motivation and Context

The following workflows currently install npm dependencies on the fly. Code scanning alerts notes this as an issue.

Workflow npm Package
doctoc.yml doctoc (latest)
markdown-link-check.yml markdown-link-check@3.14.2
prettier.yml prettier@3.9.5

By moving the package version selection from GitHub Actions to npm package.json & package-lock.json files, versions can be pinned exactly and maintained regularly by Dependabot.

Setting Dependabot and npm minimum age to 5 days for updates, reduces the risk of fast supply-chain attacks:

Testing Details

Types of changes

  • Documentation
  • Version change (Update, remove or add more Node.js versions)
  • Variant change (Update, remove or add more variants, or versions of variants)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (none of the above)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • All new and existing tests passed.

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
MikeMcC399 marked this pull request as ready for review July 22, 2026 15:35
@MikeMcC399
MikeMcC399 requested a review from nschonni July 22, 2026 15:35
Comment thread .github/workflows/doctoc.yml
Comment thread .github/workflows/markdown-link-check.yml
Comment thread .github/workflows/markdown-link-check.yml Outdated
Comment thread .github/workflows/markdown-link-check.yml
Comment thread package.json
Comment thread package.json
Comment thread package.json
Comment thread .github/workflows/prettier.yml Outdated
Comment thread .github/workflows/doctoc.yml Outdated
Comment thread package.json Outdated
@MikeMcC399
MikeMcC399 marked this pull request as draft July 23, 2026 09:14
@MikeMcC399

MikeMcC399 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@nschonni

Many thanks for your review! I think I've addressed the points you raised.

In parallel I submitted #2577 to remove https://sourceware.org/ from link testing. It has been flakily failing during my tests, so I'd just want to ignore it for future markdown-link-check tests.

@MikeMcC399
MikeMcC399 marked this pull request as ready for review July 23, 2026 11:28
@MikeMcC399 MikeMcC399 self-assigned this Jul 23, 2026
@MikeMcC399 MikeMcC399 added the ci CI (Continuous Integration) workflows label Jul 23, 2026
@MikeMcC399
MikeMcC399 requested review from nschonni and sxa July 27, 2026 10:48
@MikeMcC399

Copy link
Copy Markdown
Contributor Author

I believe this is ready to merge, however I need an approval first.

Move version definition of npm packages to
package.json & package-lock.json:
- doctoc
- markdown-link-check
- prettier

Update linting workflows.

Enable npm updating through Dependabot.
Add scripts and documentation to aid local linting.
@MikeMcC399
MikeMcC399 force-pushed the migrate/linting-npm-package branch from 4e75067 to d790558 Compare July 28, 2026 11:47

@nschonni nschonni left a comment

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.

Nothing blocking, just a few comments that can be ignored. Should still probably wait till after the Security release before landing

Comment thread .github/workflows/prettier.yml Outdated
Comment thread package.json
Comment thread package.json
@MikeMcC399

Copy link
Copy Markdown
Contributor Author

Nothing blocking, just a few comments that can be ignored. Should still probably wait till after the Security release before landing

The security release has been delayed once again. In the case of this PR I don't really see any risk. If they haven't managed to get the security release over the line this week, then I would merge anyway.

@MikeMcC399
MikeMcC399 merged commit b2a8dd9 into nodejs:main Jul 30, 2026
3 checks passed
@MikeMcC399
MikeMcC399 deleted the migrate/linting-npm-package branch July 30, 2026 07:23
@MikeMcC399

Copy link
Copy Markdown
Contributor Author

The security release is requiring manual attention in any case, so I've gone ahead and merged this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI (Continuous Integration) workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manage npm packages used in workflows

2 participants