--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx isNaN({}); (isNaN)({}); globalThis.isNaN({}); (globalThis).isNaN({}); globalThis.globalThis.window.isNaN({}); globalThis["isNaN"]({}); (globalThis)[("isNaN")]({}); function localIsNaN(isNaN) { globalThis.isNaN({}); } localIsNaN(isNaN); ``` # Diagnostics ``` invalid.js:1:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. > 1 │ isNaN({}); │ ^^^^^ 2 │ 3 │ (isNaN)({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 1 │ - isNaN({}); 1 │ + Number.isNaN({}); 2 2 │ 3 3 │ (isNaN)({}); ``` ``` invalid.js:3:2 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 1 │ isNaN({}); 2 │ > 3 │ (isNaN)({}); │ ^^^^^ 4 │ 5 │ globalThis.isNaN({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 1 1 │ isNaN({}); 2 2 │ 3 │ - (isNaN)({}); 3 │ + (Number.isNaN)({}); 4 4 │ 5 5 │ globalThis.isNaN({}); ``` ``` invalid.js:5:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 3 │ (isNaN)({}); 4 │ > 5 │ globalThis.isNaN({}); │ ^^^^^^^^^^^^^^^^ 6 │ 7 │ (globalThis).isNaN({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 3 3 │ (isNaN)({}); 4 4 │ 5 │ - globalThis.isNaN({}); 5 │ + globalThis.Number.isNaN({}); 6 6 │ 7 7 │ (globalThis).isNaN({}); ``` ``` invalid.js:7:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 5 │ globalThis.isNaN({}); 6 │ > 7 │ (globalThis).isNaN({}); │ ^^^^^^^^^^^^^^^^^^ 8 │ 9 │ globalThis.globalThis.window.isNaN({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 5 5 │ globalThis.isNaN({}); 6 6 │ 7 │ - (globalThis).isNaN({}); 7 │ + (globalThis).Number.isNaN({}); 8 8 │ 9 9 │ globalThis.globalThis.window.isNaN({}); ``` ``` invalid.js:9:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 7 │ (globalThis).isNaN({}); 8 │ > 9 │ globalThis.globalThis.window.isNaN({}); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 │ 11 │ globalThis["isNaN"]({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 7 7 │ (globalThis).isNaN({}); 8 8 │ 9 │ - globalThis.globalThis.window.isNaN({}); 9 │ + globalThis.globalThis.window.Number.isNaN({}); 10 10 │ 11 11 │ globalThis["isNaN"]({}); ``` ``` invalid.js:11:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 9 │ globalThis.globalThis.window.isNaN({}); 10 │ > 11 │ globalThis["isNaN"]({}); │ ^^^^^^^^^^^^^^^^^^^ 12 │ 13 │ (globalThis)[("isNaN")]({}); i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 9 9 │ globalThis.globalThis.window.isNaN({}); 10 10 │ 11 │ - globalThis["isNaN"]({}); 11 │ + globalThis.Number["isNaN"]({}); 12 12 │ 13 13 │ (globalThis)[("isNaN")]({}); ``` ``` invalid.js:13:1 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 11 │ globalThis["isNaN"]({}); 12 │ > 13 │ (globalThis)[("isNaN")]({}); │ ^^^^^^^^^^^^^^^^^^^^^^^ 14 │ 15 │ function localIsNaN(isNaN) { i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 13 │ (globalThis).Number[("isNaN")]({}); │ +++++++ ``` ``` invalid.js:16:5 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 15 │ function localIsNaN(isNaN) { > 16 │ globalThis.isNaN({}); │ ^^^^^^^^^^^^^^^^ 17 │ } 18 │ i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 14 14 │ 15 15 │ function localIsNaN(isNaN) { 16 │ - ····globalThis.isNaN({}); 16 │ + ····globalThis.Number.isNaN({}); 17 17 │ } 18 18 │ ``` ``` invalid.js:19:12 lint/suspicious/noGlobalIsNan FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead. 17 │ } 18 │ > 19 │ localIsNaN(isNaN); │ ^^^^^ 20 │ i See the MDN documentation for more details. i Unsafe fix: Use Number.isNaN instead. 17 17 │ } 18 18 │ 19 │ - localIsNaN(isNaN); 19 │ + localIsNaN(Number.isNaN); 20 20 │ ```