---
source: crates/oxc_linter/src/tester.rs
expression: valid_typeof
---
  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo === 'strnig'
   ·                ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ 'strnig' === typeof foo
   · ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar === 'umdefined') {}
   ·                    ───────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo !== 'strnig'
   ·                ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ 'strnig' !== typeof foo
   · ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar !== 'umdefined') {}
   ·                    ───────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo != 'strnig'
   ·               ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ 'strnig' != typeof foo
   · ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar != 'umdefined') {}
   ·                   ───────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo == 'strnig'
   ·               ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ 'strnig' == typeof foo
   · ────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar == 'umdefined') {}
   ·                   ───────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar === `umdefined`) {}
   ·                    ───────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo == 'invalid string'
   ·               ────────────────
   ╰────

  ⚠ eslint(valid-typeof): Invalid typeof comparison value.
   ╭─[valid_typeof.tsx:1:1]
 1 │ if (typeof bar !== undefined) {}
   ·                    ─────────
   ╰────
  help: Use `"undefined"` instead of `undefined`.

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo == Object
   ·               ──────
   ╰────

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo === undefined
   ·                ─────────
   ╰────
  help: Use `"undefined"` instead of `undefined`.

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ undefined === typeof foo
   · ─────────
   ╰────
  help: Use `"undefined"` instead of `undefined`.

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ undefined == typeof foo
   · ─────────
   ╰────
  help: Use `"undefined"` instead of `undefined`.

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo === `undefined${foo}`
   ·                ─────────────────
   ╰────

  ⚠ eslint(valid-typeof): Typeof comparisons should be to string literals.
   ╭─[valid_typeof.tsx:1:1]
 1 │ typeof foo === `${string}`
   ·                ───────────
   ╰────


