Skip to content

chore: build improvements and lint-staged type checking#10

Merged
frankieyan merged 4 commits into
mainfrom
frankie/build-and-lint-staged
Jan 31, 2026
Merged

chore: build improvements and lint-staged type checking#10
frankieyan merged 4 commits into
mainfrom
frankie/build-and-lint-staged

Conversation

@frankieyan

Copy link
Copy Markdown
Member

This PR improves the build pipeline by cleaning the dist folder before each build and excluding test files from the output. Also adds type checking to the pre-commit hook so type errors are caught before changes are committed.

Extracted from #8.

Test plan

  • Run npm run build and verify the dist folder is cleared before new files are written
  • Stage a TypeScript file with a type error and run npx lint-staged — it should fail with the type error
  • Stage a valid TypeScript file and run npx lint-staged — it should pass

frankieyan and others added 3 commits January 30, 2026 21:39
Add exclude pattern for test files to prevent them from being
included in the production bundle.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add rimraf to clean the dist directory before each build, ensuring
stale files from previous builds don't persist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Run tsc --noEmit when TypeScript files are staged to catch type errors
before they're committed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan requested a review from a team as a code owner January 31, 2026 05:57
@frankieyan frankieyan requested review from rfgamaral and removed request for a team January 31, 2026 05:57
@frankieyan frankieyan added the 👀 Show PR PR must be reviewed before or after merging label Jan 31, 2026

@doistbot-app doistbot-app 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.

Thank you for these improvements to the build pipeline and pre-commit checks. This update cleans the output directory before builds, excludes test files, and adds type-checking for staged files, which will help catch errors earlier and keep the build output clean. There are a couple of potential considerations regarding the type-checking implementation for individually staged files and a new dependency's Node.js version compatibility.

Documents the minimum Node.js version for contributors, addressing
feedback from PR #9 review.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan merged commit fc38a56 into main Jan 31, 2026
2 checks passed
@frankieyan frankieyan deleted the frankie/build-and-lint-staged branch January 31, 2026 06:20
Comment thread package.json
"lint-staged": {
"*.{js,ts,mjs,mts,tsx,json,md}": "biome check --write --no-errors-on-unmatched"
"*.{js,ts,mjs,mts,tsx,json,md}": "biome check --write --no-errors-on-unmatched",
"*.{ts,mts,tsx}": "tsc --noEmit"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This ended up causing tsc to ignore tsconfig.json. Will be fixed in a follow up

@rfgamaral rfgamaral left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants