A comparison is negated with !, where the opposite operator says it directly

tx0/csharp:negated-comparisonallwarningstyle/conventionsdepth faststyle

What it finds

!(a == b) is a != b, and !(a < b) is a >= b for integers and strings. The direct form is shorter and easier to read. Comparisons of floating-point values are left alone, since !(a < b) is also true when either is NaN.

From the rule's source, negated_comparison.rs.

Example from the rule's tests
class Compare{    bool Differ(int a, int b) => !(a == b);tx0 reports: !(a == b) can use != instead of negating     bool NotLess(int a, int b) => !(a < b);tx0 reports: !(a < b) can use >= instead of negating     bool Float(double a, double b) => !(a < b);}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/csharp:negated-comparison" = "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/csharp:negated-comparison] reason="..."

tx0 explain tx0/csharp:negated-comparison shows the same in the terminal. Found a false positive? Report it.