--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: inavlidSelfWrite.js --- # Input ```jsx let a = 1; (a += 1); export const e = ((a++), 5) // object assignment pattern let d, e; ({d, e} = {d: 1, e: 2}); let f; for(f = 0;; f++) {} for(f = 0; cond; f++) {} ``` # Diagnostics ``` inavlidSelfWrite.js:1:5 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is unused. > 1 │ let a = 1; │ ^ 2 │ 3 │ (a += 1); i Unused variables usually are result of incomplete refactoring, typos and other source of bugs. i Unsafe fix: If this is intentional, prepend a with an underscore. 1 │ - let·a·=·1; 1 │ + let·_a·=·1; 2 2 │ 3 │ - (a·+=·1); 4 │ - export·const·e·=·((a++),·5) 3 │ + (_a·+=·1); 4 │ + export·const·e·=·((_a++),·5) 5 5 │ 6 6 │ // object assignment pattern ``` ``` inavlidSelfWrite.js:7:5 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is unused. 6 │ // object assignment pattern > 7 │ let d, e;· │ ^ 8 │ ({d, e} = {d: 1, e: 2}); 9 │ i Unused variables usually are result of incomplete refactoring, typos and other source of bugs. i Unsafe fix: If this is intentional, prepend d with an underscore. 5 5 │ 6 6 │ // object assignment pattern 7 │ - let·d,·e;· 8 │ - ({d,·e}·=·{d:·1,·e:·2}); 7 │ + let·_d,·e;· 8 │ + ({_d,·e}·=·{d:·1,·e:·2}); 9 9 │ 10 10 │ let f; ``` ``` inavlidSelfWrite.js:7:8 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is unused. 6 │ // object assignment pattern > 7 │ let d, e;· │ ^ 8 │ ({d, e} = {d: 1, e: 2}); 9 │ i Unused variables usually are result of incomplete refactoring, typos and other source of bugs. i Unsafe fix: If this is intentional, prepend e with an underscore. 5 5 │ 6 6 │ // object assignment pattern 7 │ - let·d,·e;· 8 │ - ({d,·e}·=·{d:·1,·e:·2}); 7 │ + let·d,·_e;· 8 │ + ({d,·_e}·=·{d:·1,·e:·2}); 9 9 │ 10 10 │ let f; ``` ``` inavlidSelfWrite.js:10:5 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This variable is unused. 8 │ ({d, e} = {d: 1, e: 2}); 9 │ > 10 │ let f; │ ^ 11 │ for(f = 0;; f++) {} 12 │ for(f = 0; cond; f++) {} i Unused variables usually are result of incomplete refactoring, typos and other source of bugs. i Unsafe fix: If this is intentional, prepend f with an underscore. 8 8 │ ({d, e} = {d: 1, e: 2}); 9 9 │ 10 │ - let·f; 11 │ - for(f·=·0;;·f++)·{} 12 │ - for(f·=·0;·cond;·f++)·{} 10 │ + let·_f; 11 │ + for(_f·=·0;;·_f++)·{} 12 │ + for(_f·=·0;·cond;·_f++)·{} 13 13 │ ```