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