Skip to content

Document missing npm scripts, fix no-op eslint ignores, run Jest in CI, speed up node_modules transform - #324

Merged
chonilius merged 4 commits into
MergeFi:mainfrom
alansamdev:fix/readme-scripts-eslint-ignores-ci-test-step-jest-transform-perf
Aug 25, 2026
Merged

chonilius merged 4 commits into
MergeFi:mainfrom
alansamdev:fix/readme-scripts-eslint-ignores-ci-test-step-jest-transform-perf

Conversation

@alansamdev

Copy link
Copy Markdown
Contributor

Summary

Four fixes across documentation, tooling config, and CI:

README missing 3 of 7 scripts (#253) — npm test, npm run test:watch, and npm run verify:env were undocumented, despite verify:env running as an explicit CI step and eleven test files existing in the repo. A new contributor reading only the README would have no idea either existed. Added rows for all three.

No-op eslint ignore override (#252) — globalIgnores's comment claimed to "override default ignores of eslint-config-next," but the list passed was verbatim identical to those defaults — a no-op. Separately, .gitignore already expects a local /coverage directory once jest --coverage runs, but coverage/** was never added to the ignore list, so npm run lint would attempt to lint Istanbul's static HTML report bundle. Added coverage/** on top of the restated defaults.

CI never runs the test suite (#250) — build-and-lint ran lint, verify:env, build, verify:headers, and npm audit — no npm test step, despite a fully working Jest setup and eleven test files, including the XSS-hardening assertions in BountyDescription.test.tsx. A regression in any of them, security-relevant or not, would merge to main with a fully green CI run. Added - run: npm test right after lint, before build, so a broken test fails fast.

Blanket node_modules transform (#251) — transformIgnorePatterns: [] transformed every package under node_modules, including already-CommonJS packages that never needed it, rather than just the ESM-only react-markdown toolchain that motivated the change. Replaced it with a targeted negative-lookahead naming the ESM-only package families that actually need transforming. Iterating against a real test run caught two gaps in the initially-suggested pattern (devlop, plus several more react-markdown/rehype transitive dependencies) that would have broken BountyDescription.test.tsx — verified the full suite passes with the final pattern, including after a Jest cache clear.

Changes

  • README.md — 3 new script rows.
  • eslint.config.mjs — coverage/** added to ignores.
  • .github/workflows/ci.yml — npm test step added.
  • jest.config.ts — targeted transformIgnorePatterns regex.

Test plan

  • npx tsc --noEmit — clean
  • npm run lint (full run) — clean
  • npx jest (full suite, cache cleared) — 207/207 passing, no regressions

Closes #253
Closes #252
Closes #250
Closes #251

README's Scripts table listed five commands, but package.json defines
seven — npm test, npm run test:watch, and npm run verify:env were
undocumented. verify:env is not a minor/internal script:
.github/workflows/ci.yml runs it as an explicit CI step, yet a
contributor reading only the README had no idea it existed. npm test/
test:watch were absent too, despite eleven test files existing in the
repo — a new contributor would have no indication a test suite exists
at all, let alone how to run it locally before opening a PR.

Added rows for all three, matching the level of detail already given
to verify:headers (closes MergeFi#253).
globalIgnores' comment claimed to "override default ignores of
eslint-config-next," but the list passed was verbatim identical to
those defaults — the block changed nothing relative to using
eslint-config-next's own defaults unmodified. Separately, .gitignore
already acknowledges /coverage as expected local build output once
jest --coverage runs, but coverage/** was never added to this ignore
list — running npm run lint locally after generating a coverage report
would attempt to lint whatever static HTML report bundle Istanbul/Jest
wrote there, which isn't source code.

Added coverage/** on top of the restated defaults, so the comment's
stated intent is now true of the code (closes MergeFi#252).
build-and-lint ran npm ci, lint, verify:env, build, verify:headers, and
npm audit — no npm test step anywhere, despite package.json defining
"test": "jest" and a fully working Jest setup (jest.config.ts,
jest.setup.ts, ts-jest, jest-environment-jsdom, @testing-library/react
all present). The repo's eleven test files cover exactly the logic
this project's own issue history treats as most critical — including
the XSS-hardening assertions in BountyDescription.test.tsx that verify
markdown-based payloads render inertly — but none of them ran on any
push or pull request. A change that broke any of them, including a
security regression, would merge to main with a fully green CI run,
since the suite that would have caught it simply never executed.

Added `- run: npm test` right after lint and before build, so a broken
test fails fast (closes MergeFi#250).
transformIgnorePatterns: [] transformed every package under
node_modules that got require()'d during the suite — including
already-plain-CommonJS packages (clsx, tailwind-merge, ...) that never
needed it — rather than only the ESM-only react-markdown toolchain
(remark/rehype/unified/hast/mdast/micromark) that motivated the
change. This added unnecessary transform overhead to every test run
and every test:watch iteration, on files that were never the problem.

Replaced the blanket [] with a targeted negative-lookahead naming the
ESM-only package families that actually need transforming (by prefix,
so a new transitive dependency within one of these families is still
covered without a per-package addition each time). Iterated against a
real test run to catch two families the initial pattern missed
(devlop, plus several further react-markdown/rehype transitive
dependencies — space-separated-tokens, property-information,
stringify-entities, and others) that would have otherwise broken
BountyDescription.test.tsx; full suite (207 tests, cache cleared)
passes with the final pattern (closes MergeFi#251).
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@alansamdev is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@alansamdev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chonilius
chonilius merged commit dea5ad8 into MergeFi:main Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment