Run repository checks and review the pull request
Run lint, type checks, tests and the build, inspect package and lockfile changes and write a compact pull request review.
By Invicly Tech, , in Prompt Engineering and Vibe Coding. About 9 minutes to read.
In short
Before a pull request is reviewed, run the same checks the project runs: lint, type check, tests and the build. Then look at what the change added, especially new packages and lockfile edits. Finish with a short review that says what you checked and what you did not.
Think of it like this: It is like a pre-flight checklist: each item is quick, and skipping one is how small problems reach the air.
Explained simply
Before anyone reviews a pull request, you should have already run the checks the project uses. Those are usually lint, a type check, the tests and a production build. Each one catches a different kind of problem, so passing one does not excuse skipping another.
Run them from a clean install so a missing dependency cannot hide. Use the scripts in package.json rather than your own variants. If a check fails, fix it or say clearly in the pull request that it fails and why.
Then read what the change added to the project. A new package is code you did not write and will now trust. Ask whether it is needed, still maintained and from the publisher you expect. Look at the lockfile diff for surprises.
Finish with a short review: what changed, what you ran and its result, what you did not check, and any risks. A few honest lines beat a quick approval.
Press Play on a diagram to walk through it one step at a time.
- 1Lint
Style and common mistakes
- 2Type check
tsc finds type errors without running code
- 3Tests
Unit, integration and end-to-end suites
- 4Build
Proves the app compiles for production
- 5Diff audit
Package and lockfile changes, unexpected files
- 1Run lint, types, tests, build locallyAuthor to Author: Run lint, types, tests, build locally
- Author to CI: Push branch and open pull request2Push branch and open pull request
- CI to Author: Report check results3Report check results
- Author to Reviewer: Request review with notes4Request review with notes
- Reviewer to Author: Comments or approval5Comments or approval
- Author to CI: Fix, push, checks run again6Fix, push, checks run again
In depth
The four local checks
Lint finds style problems and common mistakes. A type check, often npx tsc --noEmit, finds type errors without producing output. Tests prove behaviour. The build proves the app compiles the way production will, and in Next.js it also catches some route and import errors.
Use npm ci for a clean, exact install from the lockfile. It fails if package.json and the lockfile disagree, which is useful information. Script names differ per project, so read the scripts section of package.json.
- npm ci: exact install from the lockfile
- Lint: style and common mistakes
- tsc --noEmit: type errors
- Tests, then the build
- 1npm ci
Clean install
- 2Lint
Seconds
- 3Type check
Seconds to a minute
- 4Tests
Minutes
- 5Build
Minutes, closest to production
Inspecting new packages
Diff package.json against the main branch. Every added line under dependencies is new code that runs in your app. Under devDependencies it runs on your machine and in CI.
For each new package, ask: is this needed, or does the platform already do it? Is it maintained? Does the name match the real project, since look-alike names are a known attack? What licence does it use? GitHub dependency review shows added packages, known vulnerabilities and licences in a pull request.
- Does the platform already do this?
- Used in more than one place?
- Small enough to write ourselves?
- Name matches the real project
- Recent releases and maintainers
- Known vulnerabilities checked
- Licence allowed
- Size acceptable
- Works with our versions
Reading lockfile changes
package-lock.json records the exact version and source of every package, including indirect ones. A small package.json change can add dozens of lockfile lines, which is normal. Look for changes that do not match the story: many unrelated version bumps, packages that appear with no parent, or a different registry in the resolved field.
Use git diff on the lockfile and scan the resolved URLs. If the lockfile changed but package.json did not, ask why. The assistant may have run an install or an update you did not request.
- Resolved URLs should point to the expected registry
- Lockfile change without package.json change needs an explanation
- Unrelated version bumps are suspicious
- Commit the lockfile with the change that needs it
A compact pull request review
Write the review so someone else can trust it quickly. Say what the change does in one line. List the checks you ran with their results. List new packages and your decision. Note risks and what you did not test. End with approve, request changes or comment.
GitHub pull request reviews let you comment on lines, then submit as approve, comment or request changes. Keep comments specific and actionable, and tie each to a line or a criterion.
- 1Summary
One line on what changed
- 2Checks run
Lint, types, tests, build with results
- 3Packages and lockfile
Added packages and verdict
- 4Risks
What is untested or uncertain
- 5Decision
Approve, comment or request changes
Learn it in 5 short steps
About 30m each. Track them with a timer in your plan.
- 1Run lint and the type check~30m
- 2Run tests and the build~30m
- 3Inspect new packages~30m
- 4Read lockfile changes~30m
- 5Write a compact review~30m
Key points
- Run lint, type check, tests and build from a clean install, using the project's own scripts.
- Check package.json for new dependencies. Ask whether each one is needed, maintained and trusted.
- Read the lockfile diff for surprises: many new packages, changed registries or unrelated version jumps.
- A compact review lists what changed, what you ran, what passed, and risks that remain.
Key terms
Tap a card to flip it. 0/5 known
Examples
npm ci
npm run lint
npx tsc --noEmit
npm test
npm run build
git diff --stat main...HEAD
git diff main...HEAD -- package.json
git diff main...HEAD -- package-lock.json | head -80Local gate commands and diff checks. Script names depend on your package.json.
Auditing a change that added a package
An assistant built a date picker and the diff shows a new package. Step 1: run npm ci and the four checks; all pass. Step 2: diff package.json and see one new dependency. Step 3: check the package name against its official repository and recent releases. Step 4: look at the lockfile diff for extra packages and resolved URLs. Step 5: ask whether the browser input type=date would do the job. Decide and write it in the review.
npm ci && npm run lint && npx tsc --noEmit && npm test && npm run build
git diff --stat main...HEAD
git diff main...HEAD -- package.json
git diff main...HEAD -- package-lock.json | grep resolved | head -20
npm ls --depth=0A compact review you can paste
This review is short but tells the author and the next reader what was verified. Step 1: summary. Step 2: results of each check. Step 3: package decision. Step 4: gaps. Step 5: decision. Replace the details with your own results. It avoids vague phrases like looks good and states what remains unknown.
Summary: adds a character counter to NoteForm (2 files).
Checks: lint pass, tsc pass, tests 14/14, build pass.
Packages: none added. Lockfile unchanged.
Not checked: Safari, screen reader.
Risk: counter counts UTF-16 units, so some emoji count as 2.
Decision: approve with one comment on line 31.Quick reference
- Run npm ci, then lint, npx tsc --noEmit, tests and the build.
- Use the project's own scripts. Check package.json for the names.
- git diff main...HEAD -- package.json shows added dependencies.
- Check each new package: needed, maintained, correct name, licence.
- Lockfile change without a package.json change needs an explanation.
- Resolved URLs in the lockfile should point at the expected registry.
- A review lists changes, checks run, packages, risks and a decision.
Common mistakes
- Reading only the source files and skipping package.json and the lockfile.
- Running tests with a stale install, so a missing dependency goes unnoticed.
- Writing "LGTM" with no note of what was actually run.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Write the command sequence for the four local checks in a project with scripts named lint, test and build.
- Exercise 2medium
A diff adds one dependency named left-padd. Describe three checks before accepting it.
- Exercise 3hard
Write a compact review for a pull request where tests fail in one file and the lockfile has 40 new lines but package.json is unchanged.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Do I need CI if I run checks locally?
- Yes. CI runs the same checks on a clean machine for everyone, so results do not depend on your setup.
- Is a lockfile change always bad?
- No. Adding a package changes it, and it should be committed. The concern is a change you cannot explain.
- How long should a review be?
- Short enough to read in a minute, with the checks you ran and any real risks. Length is not the goal.