mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-10-22 11:46:18 +00:00
80acbdc7bc04a5574bc144282ad6077edf226ad6
as
typescript-eslint 8 reports `x as T` as unnecessary when the receiver
would accept `x` unchanged, and its autofix deletes the assertion. That
is unsound when the assertion also drives inference around it:
const { validators } = found || { validators: {} as ValPoints };
loses the type of `validators`, and every later use becomes an
unresolved type (api-derive's stakerRewards after an autofix). It also
deletes assertions kept on purpose for another environment's typings.
Across api, common, ui and apps it raised 45 reports.
The plugin is now registered through withoutContextualAssertions, which
drops only that report on `as` / `<T>` assertions. Assertions to the
type an expression already has are still reported and fixed, and so
are non-null assertions a receiver makes unnecessary. A spec lints a
fixture through the real type checker with the plugin wrapped and as
published, so it fails if the filter stops filtering.
@pezkuwi/dev
A collection of shared CI scripts and development environment (configuration, dependencies) used by all @pezkuwi projects.
Included here -
- @pezkuwi/dev Common base configurations for our TypeScript projects
- @pezkuwi/dev-test A Jest-like global environment for usage alongside
node:test - @pezkuwi/dev-ts An ESM loader for TS environments
Languages
JavaScript
71.7%
TypeScript
25.5%
Shell
2.8%