--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx try { } catch (e) { e; e = 10; } try { } catch (error) { error = 100; { error = 10; } } ``` # Diagnostics ``` invalid.js:1:24 lint/suspicious/noCatchAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a catch parameter is confusing. > 1 │ try { } catch (e) { e; e = 10; } │ ^ 2 │ try { 3 │ i The catch parameter is declared here: > 1 │ try { } catch (e) { e; e = 10; } │ ^ 2 │ try { 3 │ i Use a local variable instead. ``` ``` invalid.js:5:3 lint/suspicious/noCatchAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a catch parameter is confusing. 4 │ } catch (error) { > 5 │ error = 100; │ ^^^^^ 6 │ { 7 │ error = 10; i The catch parameter is declared here: 2 │ try { 3 │ > 4 │ } catch (error) { │ ^^^^^ 5 │ error = 100; 6 │ { i Use a local variable instead. ``` ``` invalid.js:7:5 lint/suspicious/noCatchAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a catch parameter is confusing. 5 │ error = 100; 6 │ { > 7 │ error = 10; │ ^^^^^ 8 │ } 9 │ } i The catch parameter is declared here: 2 │ try { 3 │ > 4 │ } catch (error) { │ ^^^^^ 5 │ error = 100; 6 │ { i Use a local variable instead. ```