Skip to content

Fix pnpm test and pnpm lint, and run both in CI - #2777

Merged
tiagov8 merged 3 commits into
mainfrom
ci-checks
Oct 30, 2026
Merged

tiagov8 merged 3 commits into
mainfrom
ci-checks

Conversation

@tiagov8

@tiagov8 tiagov8 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Same treatment as SSWConsulting/SSW.Products#847, after a retrospective found this repo had no checks in CI. 13 workflows deploy every PR to a staging slot, and none of them run lint, tests or types.

Both of the repo's own check commands turned out to be broken, in ways that had nothing to do with the code.

pnpm test could not run at all

jest.config.ts is a TypeScript config, which Jest can only parse with ts-node — and ts-node is not a dependency. The command died before reaching a single test:

Error: Jest: 'ts-node' is required for the TypeScript configuration files.

The file is already ESM and needs no transpiling, so renaming it to jest.config.mjs fixes it with no new dependency — unlocking 203 passing tests across 24 suites that nobody could run.

pnpm lint reported 183 errors, none of them lint debt

This looked like years of accumulated debt needing a ratchet. It wasn't. Four unrelated causes:

  • ~140 in public/admin/assets — the minified TinaCMS admin bundle. It's generated and gitignored, but biome's useIgnoreFile only reads the root .gitignore, not the nested public/admin/.gitignore that ignores it. Excluded explicitly.
  • Merge conflict markers in .vscode/settings.json and .vscode/extensions.json. Both files have carried <<<<<<< HEAD since 622165c, the Gatsby-to-Next migration — so they're invalid JSON and VS Code has been silently ignoring both ever since. Resolved to the HEAD side (Biome + Next, which is what this repo uses); the other side configured ESLint, Prettier and Gatsby's .cache.
  • 41 in styles.css — Tailwind v4 directives (@source, @plugin, @custom-variant) need tailwindDirectives enabled in biome's CSS parser, exactly as the diagnostic suggests.
  • 1 — config schema pinned to 2.3.3 against a 2.4.14 CLI.

pnpm lint now checks 331 files clean, so it goes into CI as-is. No ratchet needed.

The workflow

Installs, generates the Tina client, then lints and tests on every PR. The Tina step is needed because tina/__generated__ is gitignored and two suites import the generated client; --local builds against a local GraphQL server, so no TinaCloud credentials are required.

Verified locally and on this PR: lint clean across 331 files, 203 tests passed, 8 skipped — green in 1m26s.

Still not included

tsc --noEmit has 3 errors, all one cause: redirects.json, category-uri-title-map.json and orphaned_rules.json are generated by prepare:content from SSW.Rules.Content and gitignored. Adding typecheck means checking out the content repo in CI, as build-artifacts.yml already does — doable, but it turns a 90-second job into a slow one, so it deserves its own decision.

Also worth a look

tsconfig.tsbuildinfo is tracked in git. It's a build cache, so running tsc locally dirties the working tree every time. It probably belongs in .gitignore.


🤖 Changes made by Claude Opus 5 via Claude Code

pnpm test has not been runnable: jest.config.ts needs ts-node to parse a
TypeScript config, and ts-node is not a dependency, so the command died
before reaching a single test. Renaming the config to .mjs fixes it with
no new dependency - the file is already ESM and needs no transpiling.

That unlocks 203 passing tests across 24 suites which no one could run,
and nothing ran them: 13 workflows, none of which touch lint, tests or
types. PRs were deployed to a staging slot without being checked.

Adds a workflow that installs, generates the Tina client (two suites
import it, and --local needs no credentials) and runs the suite on every
PR. Verified locally: 203 passed, 8 skipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pnpm lint reported 183 errors, which looked like years of lint debt
needing a ratchet. None of it was source code:

- ~140 were in public/admin/assets, the minified TinaCMS admin bundle.
  It is generated and gitignored, but biome's useIgnoreFile only reads
  the root .gitignore, not the nested one that ignores it. Excluded
  explicitly instead.
- The rest were parse failures, not lint rules. .vscode/settings.json
  and .vscode/extensions.json have carried unresolved merge conflict
  markers since 622165c, the Gatsby-to-Next migration - so VS Code has
  been silently ignoring both files ever since. Resolved to the HEAD
  side, which is the Biome and Next config this repo actually uses; the
  other side configured ESLint, Prettier and Gatsby's .cache.
- 41 were styles.css, where Tailwind v4 directives (@source, @plugin,
  @custom-variant) need tailwindDirectives enabled in biome's CSS
  parser, exactly as the diagnostic suggests.
- 1 was the config schema pinned to 2.3.3 against a 2.4.14 CLI.

pnpm lint now checks 331 files clean, so it goes into CI as-is and no
ratchet is needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tiagov8 tiagov8 changed the title Fix pnpm test and run the suite in CI Fix pnpm test and pnpm lint, and run both in CI Oct 22, 2026
@tiagov8
tiagov8 merged commit 617b368 into main Oct 30, 2026
1 check passed
@tiagov8
tiagov8 deleted the ci-checks branch October 30, 2026 00:14

This branch was successfully deployed

1 active deployment
staging — e4f98f50 Deployed Oct 30, 2026 by tiagov8 via Delete PR Slot #175
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