--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx a; const a = 0; const b = b; c; let c; let d = d; e; var e; var f = f; function f(a = b, b = 0) {} function g(a = a) {} ``` # Diagnostics ``` invalid.js:1:1 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is used before its declaration. > 1 │ a; │ ^ 2 │ const a = 0; 3 │ i The variable is declared here: 1 │ a; > 2 │ const a = 0; │ ^ 3 │ 4 │ const b = b; ``` ``` invalid.js:4:11 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is used before its declaration. 2 │ const a = 0; 3 │ > 4 │ const b = b; │ ^ 5 │ 6 │ c; i The variable is declared here: 2 │ const a = 0; 3 │ > 4 │ const b = b; │ ^ 5 │ 6 │ c; ``` ``` invalid.js:4:13 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is used before its declaration. 2 │ const a = 0; 3 │ > 4 │ const b = b; │ > 5 │ > 6 │ c; │ ^ 7 │ let c; 8 │ i The variable is declared here: 6 │ c; > 7 │ let c; │ ^ 8 │ 9 │ let d = d; ``` ``` invalid.js:9:9 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is used before its declaration. 7 │ let c; 8 │ > 9 │ let d = d; │ ^ 10 │ 11 │ e; i The variable is declared here: 7 │ let c; 8 │ > 9 │ let d = d; │ ^ 10 │ 11 │ e; ``` ``` invalid.js:9:11 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is used before its declaration. 7 │ let c; 8 │ > 9 │ let d = d; │ > 10 │ > 11 │ e; │ ^ 12 │ var e; 13 │ i The variable is declared here: 11 │ e; > 12 │ var e; │ ^ 13 │ 14 │ var f = f; ``` ``` invalid.js:16:16 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This parameter is used before its declaration. 14 │ var f = f; 15 │ > 16 │ function f(a = b, b = 0) {} │ ^ 17 │ 18 │ function g(a = a) {} i The parameter is declared here: 14 │ var f = f; 15 │ > 16 │ function f(a = b, b = 0) {} │ ^ 17 │ 18 │ function g(a = a) {} ``` ``` invalid.js:18:16 lint/correctness/noInvalidUseBeforeDeclaration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This parameter is used before its declaration. 16 │ function f(a = b, b = 0) {} 17 │ > 18 │ function g(a = a) {} │ ^ 19 │ i The parameter is declared here: 16 │ function f(a = b, b = 0) {} 17 │ > 18 │ function g(a = a) {} │ ^ 19 │ ```