---
source: crates/oxc_linter/src/tester.rs
expression: no_self_compare
---
  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:5]
 1 │ if (x === x) { }
   ·     ─     ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:5]
 1 │ if (x !== x) { }
   ·     ─     ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:5]
 1 │ if (x > x) { }
   ·     ─   ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:5]
 1 │ if ('x' > 'x') { }
   ·     ───   ───
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:14]
 1 │ do {} while (x === x)
   ·              ─     ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x === x
   · ─     ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x !== x
   · ─     ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x == x
   · ─    ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x != x
   · ─    ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x > x
   · ─   ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x < x
   · ─   ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x >= x
   · ─    ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ x <= x
   · ─    ─
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:1]
 1 │ foo.bar().baz.qux >= foo.bar ().baz .qux
   · ─────────────────    ───────────────────
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.

  ⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
   ╭─[no_self_compare.tsx:1:27]
 1 │ class C { #field; foo() { this.#field === this.#field; } }
   ·                           ───────────     ───────────
   ╰────
  help: If you are testing for NaN, you can use Number.isNaN function.
