Skip to content

feat(lint-js): add optional type checking - #73

Open
Adi-ty wants to merge 1 commit into
mainfrom
feat/lint-js-typecheck
Open

Adi-ty wants to merge 1 commit into
mainfrom
feat/lint-js-typecheck

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Adds an optional type-check to ci-lint-js.yml, so a TypeScript project can run tsc through the shared workflow instead of a hand-written job beside wp-ci.yml. It is off unless typecheck-command is set.

Closes

Part of #51: the ci-lint-js gap "ESLint only, no TypeScript type check".

Changes

  • ci-lint-js.yml gains typecheck-command (default "", which skips it). A Type-check step runs it after ESLint over the whole project, whatever changed, because a type error can surface in a file the change did not touch.
  • The step runs when ESLint fails too, as long as npm ci succeeded, so one run reports lint errors and type errors together.
  • wp-ci.yml forwards typecheck-command to lint-js.
  • The job keeps name: ESLint, so no check name changes.
  • examples/ci-lint-js.yml and the README index row show the new input.

How I verified

$ actionlint .github/workflows/*.yml examples/*.yml
$ bin/check-workflows.sh
Workflow/example contract check passed.
$ pipx run yamllint 

Acceptance criteria

Runtime behavior

  • typecheck-command empty: lint-js runs the same steps as before
  • A consumer run with a type error fails Type-check
  • A consumer run with both an ESLint error and a type error reports both

Code quality

  • Lint — zero errors
  • Static analysis — zero errors
  • Tests pass (n/a: no scripts changed)

Housekeeping

  • PR title is a Conventional Commit — release-please writes CHANGELOG.md from it
  • examples/<workflow>.yml added or updated to match any input change
  • yamllint, actionlint and bin/check-workflows.sh pass locally

Reviewer notes

  • Type-check is a step in lint-js rather than its own leaf: it reuses the job's npm ci, and needs no new job id in the presets, known or skip.
  • lint-js only runs when detect-changes puts something in the js bucket. .ts, .tsx and tsconfig*.json count there from @rtcamp/wp-tooling 2.1.0 (feat(detect-changes): count ES-module and TypeScript files in the js bucket wp-tooling#80). Until that is on npm, a PR that changes only TypeScript files skips lint-js, and with it the type-check.

Conventions: AGENTS.md · PR process: CONTRIBUTING.md

@Adi-ty
Adi-ty marked this pull request as ready for review November 20, 2026 09:33
Copilot AI balanced review requested due to automatic review settings November 20, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

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.

2 participants