unnecessary-sort-comparator Disallow comparators that reproduce the natural ordering A comparator that only calls left.compare(right) selects the collection element's natural order. Instead, you SHOULD omit the comparator and use the natural-order overload. - Category: performance - Level: warning - Fix: automatic - Scope: module Reported function order(values: int32[]): void { values.sort((left, right) => left.compare(right)); } Accepted function order(values: int32[]): void { values.sort(); } Prior art - Clippy ยท unnecessarysortby language/linter/src/rules/performance/unnecessarysortcomparator.rs:10