Skip to content

fix: remove non-null assertions to resolve biome lint warnings#74

Open
mehmetkr-31 wants to merge 1 commit intobase:mainfrom
mehmetkr-31:fix/biome-ci-lint-and-format-issues
Open

fix: remove non-null assertions to resolve biome lint warnings#74
mehmetkr-31 wants to merge 1 commit intobase:mainfrom
mehmetkr-31:fix/biome-ci-lint-and-format-issues

Conversation

@mehmetkr-31
Copy link
Copy Markdown

Summary

  • Remove two forbidden non-null assertions (!) flagged by biome's noNonNullAssertion rule
  • Replace with proper type narrowing to maintain the same runtime safety guarantees

Changes

src/core/protocol/engines/base-engine.ts

The array length is already validated to be exactly 1 on line 342, so the ! on msgInitEvents[0] is unnecessary. Removed the assertion since TypeScript can infer the value is defined after the length check.

src/core/protocol/routes/svm-to-base.ts

evmCall is guaranteed non-null when getBufferableCallData() returns a non-null result (it returns null early if !call). Instead of using evmCall!, added an explicit evmCall truthiness check to the conditional (if (bufferableData && evmCall)), which lets TypeScript narrow the type naturally.

Verification

  • bun run check:ci passes with 0 errors and 0 warnings
  • All 242 tests pass

Fixes #73

Replace forbidden non-null assertions (!) with proper type narrowing:
- base-engine.ts: remove unnecessary ! since array length is already
  validated to be exactly 1
- svm-to-base.ts: add explicit evmCall truthiness check to the
  conditional instead of using non-null assertion

Fixes base#73
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.

fix: biome CI check fails — formatting error in client.ts and non-null assertion warnings

1 participant