Skip to content

chore: convert lint-staged config to TypeScript - #32

Merged
Mearman merged 9 commits into
mainfrom
chore/lint-staged-config-ts
Sep 4, 2026
Merged

chore: convert lint-staged config to TypeScript#32
Mearman merged 9 commits into
mainfrom
chore/lint-staged-config-ts

Conversation

@Mearman

@Mearman Mearman commented Sep 4, 2026

Copy link
Copy Markdown
Member

lint-staged.config.js carried a comment explaining why it stayed plain JS: lint-staged dynamically imports its raw config file, and a .ts config only loads without a flag once Node's native type-stripping runs unflagged.

An earlier revision of this PR mistakenly attributed that floor to Node >=23.6 only and, on that basis, raised the Node baseline, bumped CI to Node 24, and widened CI timeouts to cover a slower npm ci under Node 24. That premise was wrong: Node backported the same default-enable to the 22.x LTS line at v22.18.0, and CI's actions/setup-node node-version: "22" pin already resolves to a release past that. Those changes were reverted.

The final diff is:

  • lint-staged.config.ts (renamed from .js), using lint-staged's own defineConfig helper, matching the repository's other *.config.ts files.
  • A new package.json engines.node field (>=22.22.1 <23.0.0 || >=23.6.0): the floor is set by lint-staged@17.4.1's own declared engines.node requirement, which is higher than the type-stripping requirement alone (>=22.18.0) would need, with no change to CI's Node version.
  • commitlint/typecheck/lint/format's CI timeout-minutes raised from 5 to 10: npm ci has intermittently taken most of 5 minutes on GitHub's shared runners even with a warm actions/setup-node cache, observed on both Node 22 and Node 24, so this is independent of the Node-version revert above.

Verified locally: lint-staged --debug loads and runs the .ts config successfully, and typecheck/lint/format:check/actionlint all pass.

Node's native TypeScript type-stripping only runs unflagged from 23.6
onward; CI's actions/setup-node steps and the release job now pin the
current LTS (24) to satisfy that floor, and package.json declares the
real minimum via "engines". This unblocks converting lint-staged's own
config to a real .ts file in the next commit.
lint-staged dynamically imports its raw config file, so a .ts config
only loads without a flag once Node's native type-stripping is
unflagged (23.6+, now the repository's declared minimum). Matches the
repository's other *.config.ts files and uses lint-staged's own
defineConfig helper for a typed Configuration object instead of a bare
default export.
npm ci has been taking most of 5 minutes to install this repository's
dependencies under npm 11 (bundled with the Node 24 baseline), even
with a fully warm actions/setup-node cache -- against a prior baseline
of well under a minute on Node 22's bundled npm. The existing 5-minute
timeout on commitlint/typecheck/lint/format left too little margin and
was intermittently cancelling jobs mid-install; raised to 10 minutes.
@Mearman
Mearman marked this pull request as ready for review September 4, 2026 07:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-04T08:03:06.821440Z 2fd2a43 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

claude[bot]
claude Bot previously requested changes Sep 4, 2026
Comment thread lint-staged.config.ts Outdated
Node backported "type stripping enabled by default" to both v23.6.0
and the 22.x LTS line at v22.18.0, not only to v23.6.0+ as the prior
comment claimed. actions/setup-node's node-version: "22" resolves to
the latest 22.x release, already past 22.18.0, so lint-staged.config.ts
never needed a Node baseline bump to load as a real .ts file. Declares
the actual constraint via "engines" instead of an unnecessarily high
floor.
@claude
claude Bot dismissed their stale review September 4, 2026 08:10

Superseded by re-review on the latest commit.

claude[bot]
claude Bot previously approved these changes Sep 4, 2026
Comment thread lint-staged.config.ts Outdated
npm ci installing this repository's dependencies has intermittently
taken most of 5 minutes on GitHub's shared runners even with a warm
actions/setup-node cache -- observed on both Node 22 and Node 24, so
it isn't tied to a specific Node version. Raised commitlint/typecheck/
lint/format's timeout-minutes from 5 to 10 for real margin.
@claude
claude Bot dismissed their stale review September 4, 2026 08:16

Superseded by re-review on the latest commit.

claude[bot]
claude Bot previously approved these changes Sep 4, 2026
"see the 'engines' field below" read as if the field were further
down this same file, when it's actually in package.json.
@claude
claude Bot dismissed their stale review September 4, 2026 08:27

Superseded by re-review on the latest commit.

claude[bot]
claude Bot previously requested changes Sep 4, 2026
Comment thread package.json Outdated
lint-staged@17.4.1 declares its own engines.node of >=22.22.1, higher
than the >=22.18.0 this repository previously declared -- a
contributor between those two versions would satisfy this repository's
stated floor but still hit an EBADENGINE warning installing lint-staged
itself. Bumped to match, and reworded the comment in
lint-staged.config.ts so it no longer implies the "engines" floor is
set purely by the type-stripping requirement.
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Claude finished — see below for the result. View job run

@claude
claude Bot dismissed their stale review September 4, 2026 08:32

Superseded by re-review on the latest commit.

@claude claude Bot 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.

Re-review on the latest commit (491d8c10). The one open Should-fix from my prior review — package.json's engines.node floor being looser than what lint-staged@17.4.1 itself requires — is fixed: the floor is now >=22.22.1, matching lint-staged's own declared engines.node (>=22.22.1, confirmed directly in package-lock.json). That thread, and the two earlier ones from this PR's history, were already resolved by an earlier pass; I've cleared and dismissed my own stale CHANGES_REQUESTED review from 659db9a7, which predates this fix.

No new findings on the delta since that review (only lint-staged.config.ts's comment and package.json's floor changed, both correctly).

I updated the PR description: it still quoted the pre-fix engines.node value (>=22.18.0 ...) instead of the final >=22.22.1 ..., and didn't explain why the floor is 22.22.1 rather than the type-stripping requirement's own 22.18.0. Title was already accurate and left unchanged. No open issue or PR tracks or overlaps this change.

Nothing else outstanding. Approving.

@Mearman
Mearman merged commit a27b95a into main Sep 4, 2026
13 checks passed
@Mearman
Mearman deleted the chore/lint-staged-config-ts branch September 4, 2026 08:53
@ExaDev ExaDev deleted a comment from github-actions Bot Sep 4, 2026
@ExaDev ExaDev deleted a comment from github-actions Bot Sep 4, 2026
@ExaDev ExaDev deleted a comment from github-actions Bot Sep 4, 2026
@ExaDev ExaDev deleted a comment from github-actions Bot Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant