danielnixon / eslint-plugin-total-functions

An ESLint plugin to enforce the use of total functions (and prevent the use of partial functions) in TypeScript.
MIT License
87 stars 4 forks source link

no-unsafe-type-assertion: redundant thanks to `satisfies`? #746

Open danielnixon opened 1 year ago

danielnixon commented 1 year ago

See https://github.com/microsoft/TypeScript/issues/47920 and https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator

Samuel-Therrien-Beslogic commented 1 month ago

Even if satisfies exists, people still use good ol' casting a lot of the time. An equivalent rule "no cast (use satisfies)" that can still be configured as warning or disabled when too complex would still be needed imo to replace no-unsafe-type-assertion (maybe it already exists in a plugin)

Edit: This with option "never": https://typescript-eslint.io/rules/consistent-type-assertions/ Edit 2: typescript-eslint is accepting PRs for this rule: https://github.com/typescript-eslint/typescript-eslint/issues/7173