menu

require-is-empty-with-length

Require isEmpty alongside a length accessor

A visible length property without isEmpty makes callers derive a common collection predicate themselves. Instead, you SHOULD provide isEmpty in the same static or instance namespace.

Reported

1interface Sequence {2    get length(): isize;3}

Accepted

1interface Sequence {2    get length(): isize;3    get isEmpty(): boolean;4}