Skip to content

rm strictNullChecks globally#2973

Merged
RobinTail merged 2 commits intomasterfrom
strict-strictNullChecks
Sep 28, 2025
Merged

rm strictNullChecks globally#2973
RobinTail merged 2 commits intomasterfrom
strict-strictNullChecks

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Sep 28, 2025

because already covered by strict by @tsconfig/node20 base

Summary by CodeRabbit

  • Chores
    • Updated TypeScript configuration by disabling strict null checks, reducing nullability strictness during development and builds.
    • Tooling-only adjustment to improve developer experience and compatibility; no changes to public APIs.
    • No user-facing impact: application behavior, features, performance, and UI remain unchanged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 28, 2025

Walkthrough

The change removes the strictNullChecks compiler option from the TypeScript configuration file, thereby relaxing how TypeScript enforces null and undefined handling in the codebase. No other configuration settings were modified, and no code files were altered.

Changes

Cohort / File(s) Change Summary
TypeScript Configuration
`tsconfig.json`
Removed the strictNullChecks option from the config.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Root tsconfig #2890: Both PRs modify the TypeScript configuration, specifically the root tsconfig settings, which directly relates to this change.

Poem

A bunny hops through fields of Type,
Where null and undefined could cause a gripe,
But with strict checking now undone,
The TypeScript meadow’s less uptight—more fun!
Tread lightly, coders, in this expanse,
For unchecked nulls may someday prance! 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change of removing the strictNullChecks option globally from the TypeScript configuration, giving a clear summary of the pull request’s intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch strict-strictNullChecks

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78de8a7 and 056bf2b.

📒 Files selected for processing (1)
  • tsconfig.json (0 hunks)
💤 Files with no reviewable changes (1)
  • tsconfig.json

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@RobinTail RobinTail added the refactoring The better way to achieve the same result label Sep 28, 2025
@coveralls-official
Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling 056bf2b on strict-strictNullChecks
into 78de8a7 on master.

@RobinTail
Copy link
Copy Markdown
Owner Author

thereby relaxing how TypeScript enforces null and undefined handling

@coderabbitai, no relaxing. The tsconfig.json in root of the project extends from @tsconfig/node20/tsconfig.json that contains strict: true, that implies strictNullChecks too. So it's just a cleanup.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 28, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@RobinTail Thank you for the correction! You're absolutely right. I can see that the tsconfig.json extends from @tsconfig/node20/tsconfig.json, and the @tsconfig/node20 configuration includes "strict": true, which indeed implies strictNullChecks: true by default.

Since strict is a shorthand that enables several strict type-checking options including strictNullChecks, removing the explicit strictNullChecks: true from your configuration is indeed just cleanup rather than relaxing the type checking. The null and undefined handling remains equally strict through the inherited strict: true setting.

I apologize for the initial mischaracterization - this is purely a cleanup change to remove redundant configuration.


🏁 Script executed:

#!/bin/bash
# Let's examine the tsconfig.json file to see the configuration
cat tsconfig.json

Length of output: 210


🌐 Web query:

@tsconfig/node20 tsconfig.json strict strictNullChecks configuration

💡 Result:

Short answer: @tsconfig/node20 sets "strict": true (so strictNullChecks is enabled). To change it, extend the package and override compilerOptions.strictNullChecks (or strict) in your tsconfig.json.

Example tsconfig override:
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"strictNullChecks": false
}
}

Notes:

  • The @tsconfig/node20 base sets "strict": true in its tsconfig. (npmjs.com)
  • The TypeScript "strict" option enables strictNullChecks (and other strict flags); you can still override any strict sub-option individually. (github.com)

Citations:


@RobinTail Thank you for the correction! You're absolutely right. I can see that the tsconfig.json extends from @tsconfig/node20/tsconfig.json, and the @tsconfig/node20 configuration includes "strict": true, which indeed implies strictNullChecks: true by default.

Since strict is a shorthand that enables several strict type-checking options including strictNullChecks, removing the explicit strictNullChecks: true from your configuration is indeed just cleanup rather than relaxing the type checking. The null and undefined handling remains equally strict through the inherited strict: true setting.

I apologize for the initial mischaracterization - this is purely a cleanup change to remove redundant configuration.


✏️ Learnings added
Learnt from: RobinTail
URL: https://github.com/RobinTail/express-zod-api/pull/2973

Timestamp: 2025-09-28T10:09:35.667Z
Learning: In TypeScript configuration, when `strict: true` is set (including through extended configurations like tsconfig/node20), it automatically enables strictNullChecks along with other strict type-checking options, making explicit `strictNullChecks: true` redundant.

Learnt from: RobinTail
URL: https://github.com/RobinTail/express-zod-api/pull/2973

Timestamp: 2025-09-28T10:09:35.667Z
Learning: In TypeScript configuration, when `strict: true` is set (including through extended configurations like tsconfig/node20), it automatically enables strictNullChecks along with other strict type-checking options, making explicit `strictNullChecks: true` redundant.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@RobinTail RobinTail merged commit cb4a82c into master Sep 28, 2025
13 checks passed
@RobinTail RobinTail deleted the strict-strictNullChecks branch September 28, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant