Skip to content

ci(typecheck): check JSDoc types with tsc in CI (part 1) - #4272

Merged
PierreBrisorgueil merged 2 commits into
masterfrom
ci/typecheck-part1
Nov 12, 2026
Merged

PierreBrisorgueil merged 2 commits into
masterfrom
ci/typecheck-part1

Conversation

@PierreBrisorgueil

Copy link
Copy Markdown
Contributor

What / Why

TypeScript now checks the JSDoc types we already write, in CI (part 1 of 2).
No behaviour change.

Tech detail

  • tsconfig.check.json: allowJs + checkJs + noEmit, loose settings, explicit stack folder include (lib, config, server.js, modules core/home/audit/public/tasks); tests excluded.
  • typescript pinned to 5.9.3, new npm run typecheck, CI step added after lint on the unit job.
  • ~81 errors fixed, mostly JSDoc.
  • 3 behaviour-identical code edits (per the scope note on the issue): readFileSync with utf8, winston.createLogger without new, unused argument dropped in the initModulesServerPolicies call.
  • Dead options removed: helmet hsts force (not in helmet 8); aggregate noCursorTimeout (only read by find in mongodb 7).
  • 1 @ts-expect-error (Stripe pinned apiVersion, as stripe-node docs advise).

Downstream note

Projects inherit the config and the CI step. The include list names stack folders only, so project modules are not checked unless a project adds them.

Review

Pre-push review OK with nits, security pass no HIGH/MEDIUM.

Closes #4269

Add tsconfig.check.json (explicit stack folders), pin typescript 5.9.3,
add npm run typecheck and a CI step on the unit job after lint.
Fix the JSDoc errors tsc reports; drop the dead helmet hsts force
and aggregate noCursorTimeout options. One @ts-expect-error for the
Stripe pinned apiVersion (documented by stripe-node).

Closes #4269
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8a6a23e and 8ca7b4a.

Files ignored due to path filters: 1

  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 37

  • .github/workflows/CI.yml
  • README.md
  • config/index.js
  • lib/app.js
  • lib/helpers/AppError.js
  • lib/helpers/abilities.js
  • lib/helpers/config.js
  • lib/helpers/files.js
  • lib/helpers/mailer/index.js
  • lib/helpers/mailer/provider.nodemailer.js
  • lib/helpers/mailer/provider.resend.js
  • lib/helpers/responses.js
  • lib/middlewares/policy.js
  • lib/middlewares/rateLimiter.js
  • lib/services/analytics.js
  • lib/services/distributedLock.js
  • lib/services/express.js
  • lib/services/logger.js
  • lib/services/migrations.js
  • lib/services/mongoose.js
  • lib/services/multer.js
  • modules/audit/repositories/audit.repository.js
  • modules/audit/services/audit.service.js
  • modules/billing/lib/billing.stripe-errors.js
  • modules/billing/lib/stripe.js
  • modules/core/repositories/migration.repository.js
  • modules/home/repositories/home.repository.js
  • modules/organizations/repositories/organizations.membership.repository.js
  • modules/organizations/repositories/organizations.repository.js
  • modules/organizations/services/organizations.membership.service.js
  • modules/tasks/models/tasks.model.mongoose.js
  • modules/tasks/repositories/tasks.repository.js
  • modules/uploads/repositories/uploads.repository.js
  • modules/users/repositories/users.repository.js
  • modules/users/services/users.service.js
  • package.json
  • tsconfig.check.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.64%. Comparing base (8a6a23e) to head (8ca7b4a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4272   +/-   ##
=======================================
  Coverage   94.64%   94.64%           
=======================================
  Files         175      175           
  Lines        6218     6220    +2     
  Branches     2020     2018    -2     
=======================================
+ Hits         5885     5887    +2     
  Misses        270      270           
  Partials       63       63           
Flag Coverage Δ
integration 64.82% <72.72%> (+0.01%) ⬆️
unit 80.32% <81.81%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a6a23e...8ca7b4a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil
PierreBrisorgueil merged commit 3e2098d into master Nov 12, 2026
8 checks passed
@PierreBrisorgueil
PierreBrisorgueil deleted the ci/typecheck-part1 branch November 12, 2026 14:22
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.

🔧 Check JSDoc types in CI (part 1: lib, config, small modules)

1 participant