eslint-plugin-ts-data-forge@0.4.0
Minor Changes
-
0dcdcbc:
prefer-is-record-and-has-keynow drops theisRecord(...)conjunct when the
object already satisfieshasKey'sR extends UnknownRecordconstraint, so
Object.hasOwn(record, key)on a record-typed value rewrites to
hasKey(record, key)instead ofisRecord(record) && hasKey(record, key).The check needs type information; without it the guard is kept, as before. It
is deliberately conservative — a type TypeScript would accept through an
implicit index signature keeps the guard — and callables and arrays keep it
too, becauseisRecordrejects those at runtime.no-unnecessary-type-guardrecognizesisRecordfor the same reason: it now
reportsisRecord(x)as alwaystruewhen every union member already
satisfiesUnknownRecord, and as alwaysfalsewhen none of them can (every
primitive, array, tuple and callable).
Patch Changes
- 938bc58: Widen the
@typescript-eslint/utilsdependency to^8.65.0and pin
ts-type-forgeto~9.1.1.