# No non-null assertions in the API and the native app

typescript/no-non-null-assertion is now an error in packages/api/src and apps/mobile/src outside tests. The 56 existing assertions were replaced by narrowing or by types that carry the guarantee.

- **`value!` is a lint error in `packages/api/src` and `apps/mobile/src`.** A non-null assertion tells the compiler that a value exists and checks nothing, so a missing value fails later as a `TypeError` far from its cause. Tests are exempt. Rule, reason and the ways to narrow instead: [backend conventions](/docs/development/backend-conventions#no-non-null-assertion). ([#236](https://github.com/CarlosZiegler/fofo/pull/236))
- **The 56 assertions outside tests are gone, without a cast.** The feedback image sniffer reads header fields through a `DataView`; the billing webhook handlers get their provider's settings already narrowed from the shared receive step; the Stripe subscription schema types its items as a non-empty tuple; and `firstRow(rows)` in `packages/api/src/platform/db/first-row.ts` returns the row of a statement that always returns one (`INSERT … RETURNING`, an aggregate) or throws. A new service uses the same helper instead of `row!`. ([#236](https://github.com/CarlosZiegler/fofo/pull/236))
