no-typeof-undefined
UnreleasedConfiguration
rslint.config.ts
Disallow comparing undefined using typeof.
Prefer a direct comparison:
By default, references that resolve to globals are ignored because removing
typeof can turn an existence check into a ReferenceError. Set
checkGlobalVariables: true to report those cases as suggestions instead of
autofixes.
This port follows eslint-plugin-unicorn v75.0.0, including converting
==/!= to strict equality, ASI-sensitive replacements, and multiline return/throw handling. Autofixes are intentionally withheld for the browser document.all legacy object, including binding-aware globalThis, window, self, frames, top, and parent Window aliases, because replacing typeof … === 'undefined' there would change runtime behavior.