prefer-negative-index Prefer negative indices in equivalent at calls array.at(array.length as isize - offset) performs the same lookup as array.at(-offset) for a positive constant offset. Instead, you SHOULD pass the negative offset directly. - Category: style - Level: warning - Fix: automatic - Scope: module Reported function penultimate(values: int32[]): int32 | undefined { return values.at((values.length as isize) - 2); } Accepted function penultimate(values: int32[]): int32 | undefined { return values.at(-2); } Prior art - eslint-plugin-unicorn ยท prefer-negative-index language/linter/src/rules/style/prefernegativeindex.rs:8