Skip to content

chore(strict): enable exactOptionalPropertyTypes and no-non-null-assertion - #68

Merged
edhor1608 merged 1 commit into
mainfrom
chore/ts-ultra-strict
Aug 2, 2026
Merged

edhor1608 merged 1 commit into
mainfrom
chore/ts-ultra-strict

Conversation

@edhor1608

@edhor1608 edhor1608 commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Stage 1 of the TypeScript ultra-strict hardening rolled out across all active repos: adds exactOptionalPropertyTypes to tsconfig.json (noUncheckedIndexedAccess was already enabled) and typescript/no-non-null-assertion: error to .oxlintrc.json. Zero fallout — the codebase was already clean. Verified: typecheck, lint, 20 tests green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WZiaeDvfVP6fgSM6hhg2bc

Summary by CodeRabbit

  • Chores
    • Strengthened TypeScript validation for optional properties.
    • Added stricter linting to prevent unsafe non-null assertions.

Note

Enable exactOptionalPropertyTypes and no-non-null-assertion strict TypeScript checks

Adds exactOptionalPropertyTypes: true to tsconfig.json and the typescript/no-non-null-assertion rule (as error) to .oxlintrc.json. Risk: these are stricter type checks that may surface new type errors in existing code.

Macroscope summarized 9c93e45.

…rtion

Continues the ultra-strict TypeScript hardening: adds
exactOptionalPropertyTypes to tsconfig.json and typescript/no-non-null-
assertion to .oxlintrc.json. noUncheckedIndexedAccess was already
present. No fallout — both flags pass clean against the existing
codebase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WZiaeDvfVP6fgSM6hhg2bc
@edhor1608
edhor1608 merged commit be02f9f into main Aug 2, 2026
4 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ad3719d1-c4a3-4e5a-a278-785d50cd67ee

📥 Commits

Reviewing files that changed from the base of the PR and between f958594 and 9c93e45.

📒 Files selected for processing (2)
  • .oxlintrc.json
  • tsconfig.json

📝 Walkthrough

Walkthrough

Updated Oxlint to report TypeScript non-null assertions as errors. Enabled TypeScript’s exactOptionalPropertyTypes compiler option.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ts-ultra-strict
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/ts-ultra-strict

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.

edhor1608 added a commit that referenced this pull request Aug 2, 2026
main enabled `exactOptionalPropertyTypes` (#68) plus
`typescript/strict-boolean-expressions` and `typescript/no-non-null-assertion`
(#69) while this PR was open. Both sides had rewritten
`src/cli/prepare_image.ts`, but not as competing implementations: main adapted
the old architecture's expressions to the new rules, while this branch had
already moved directory enumeration and output allocation into the domain behind
`prepareImages()`. The resolution keeps this branch's thin CLI and takes only
main's strict idioms.

The new rules also reach code outside the conflict:

- `image_engine.ts`: three truthiness checks made explicit. All are equivalent --
  `getSupportedString` returns an allowlisted value or null and never "", and
  `sourceCrop` is an object or undefined.
- `prepare_image.ts`: `?.isDirectory()` / `?.isFile()` compared against `true`,
  since optional chaining yields `boolean | undefined`.
- `tests/helpers/cli.ts`: `env: undefined` is no longer assignable to an optional
  property, so the key is now omitted entirely when no override is passed.

No behavior change; all 26 acceptance tests pass unmodified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFTLY9M1HfSALwHBMTEyPi
Entire-Checkpoint: 4448d79cc6d0
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.

1 participant