Repository navigation
Document missing npm scripts, fix no-op eslint ignores, run Jest in CI, speed up node_modules transform - #324
Merged
chonilius merged 4 commits intoAug 25, 2026
Conversation
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).
|
@alansamdev is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four fixes across documentation, tooling config, and CI:
README missing 3 of 7 scripts (#253) —
npm test,npm run test:watch, andnpm run verify:envwere undocumented, despiteverify:envrunning 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,.gitignorealready expects a local/coveragedirectory oncejest --coverageruns, butcoverage/**was never added to the ignore list, sonpm run lintwould attempt to lint Istanbul's static HTML report bundle. Addedcoverage/**on top of the restated defaults.CI never runs the test suite (#250) —
build-and-lintran lint,verify:env, build,verify:headers, andnpm audit— nonpm teststep, despite a fully working Jest setup and eleven test files, including the XSS-hardening assertions inBountyDescription.test.tsx. A regression in any of them, security-relevant or not, would merge tomainwith a fully green CI run. Added- run: npm testright after lint, before build, so a broken test fails fast.Blanket node_modules transform (#251) —
transformIgnorePatterns: []transformed every package undernode_modules, including already-CommonJS packages that never needed it, rather than just the ESM-onlyreact-markdowntoolchain 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 morereact-markdown/rehypetransitive dependencies) that would have brokenBountyDescription.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 teststep added.jest.config.ts— targetedtransformIgnorePatternsregex.Test plan
npx tsc --noEmit— cleannpm run lint(full run) — cleannpx jest(full suite, cache cleared) — 207/207 passing, no regressionsCloses #253
Closes #252
Closes #250
Closes #251