Requires Node ≥ 24. asserticide refuses to run if the project doesn't typecheck cleanly under tsgo. Commit your working tree first so you can review the diff afterwards.
Sample output:
---total assertions found: 412removed assertions: 287reverted by typecheck: 118preserved by rule: 7files changed: 54- src/api/client.ts- src/components/Grid.tsx- ...
How it compares to no-unnecessary-type-assertion
The difference is scale.
The @typescript-eslint/no-unnecessary-type-assertion lint rule works at the expression level: it reports an assertion when removing it preserves the expression type or still satisfies the contextual type at that position.
asserticide works at project level: it tries deleting each type assertion, runs tsgo, and keeps the edit if the checked project still typechecks and no preservation rule applies.
So asserticide can remove assertions with real local type effects when those effects are unused projectwide.