The legacy names trimLeft or trimRight are called
What it finds
trimLeft and trimRight are old names kept for compatibility; the standard names are trimStart and trimEnd, which also read correctly for text written right to left.
Reported are method calls named trimLeft or trimRight without arguments. The fix writes the standard name; it is unsafe, since the receiver may be an object other than a string with a method of the old name.
From the rule's source, trim_left_right.rs.
export const a = " x ".trimLeft();tx0 reports: trimLeft is a legacy nameexport const b = " x ".trimStart(); Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:trim-left-right" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:trim-left-right] reason="..."tx0 explain tx0/ts:trim-left-right shows the same in the terminal. Found a false positive? Report it.