value!is a lint error inpackages/api/srcandapps/mobile/src. A non-null assertion tells the compiler that a value exists and checks nothing, so a missing value fails later as aTypeErrorfar from its cause. Tests are exempt. Rule, reason and the ways to narrow instead: backend conventions. (#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; andfirstRow(rows)inpackages/api/src/platform/db/first-row.tsreturns the row of a statement that always returns one (INSERT … RETURNING, an aggregate) or throws. A new service uses the same helper instead ofrow!. (#236)
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.
Edit on GitHubDocumentation is in English.