--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs function foo(bar) { bar = 13; } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { bar = 13; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { bar = 13; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { bar += 13; } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { bar += 13; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { bar += 13; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { (function() { bar = 13; })(); } ``` # Diagnostics ``` invalid.jsonc:1:35 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { (function() { bar = 13; })(); } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { (function() { bar = 13; })(); } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { ++bar; } ``` # Diagnostics ``` invalid.jsonc:1:23 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { ++bar; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { ++bar; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { ++bar; } ``` # Diagnostics ``` invalid.jsonc:1:23 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { ++bar; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { ++bar; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { --bar; } ``` # Diagnostics ``` invalid.jsonc:1:23 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { --bar; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { --bar; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { bar--; } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { bar--; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { bar--; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { bar--; } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { bar--; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { bar--; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { bar--; } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { bar--; } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { bar--; } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { ({bar} = {}); } ``` # Diagnostics ``` invalid.jsonc:1:23 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { ({bar} = {}); } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { ({bar} = {}); } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { ({x: [, bar = 0]} = {}); } ``` # Diagnostics ``` invalid.jsonc:1:29 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { ({x: [, bar = 0]} = {}); } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { ({x: [, bar = 0]} = {}); } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { for (bar in baz); } ``` # Diagnostics ``` invalid.jsonc:1:26 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { for (bar in baz); } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { for (bar in baz); } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(bar) { for (bar of baz); } ``` # Diagnostics ``` invalid.jsonc:1:26 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(bar) { for (bar of baz); } │ ^^^ i The parameter is declared here: > 1 │ function foo(bar) { for (bar of baz); } │ ^^^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { ({a} = obj); } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { ({a} = obj); } │ ^ i The parameter is declared here: > 1 │ function foo(a) { ({a} = obj); } │ ^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { ([...a] = obj); } ``` # Diagnostics ``` invalid.jsonc:1:24 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { ([...a] = obj); } │ ^ i The parameter is declared here: > 1 │ function foo(a) { ([...a] = obj); } │ ^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { ({...a} = obj); } ``` # Diagnostics ``` invalid.jsonc:1:24 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { ({...a} = obj); } │ ^ i The parameter is declared here: > 1 │ function foo(a) { ({...a} = obj); } │ ^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { a &&= b; } ``` # Diagnostics ``` invalid.jsonc:1:19 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { a &&= b; } │ ^ i The parameter is declared here: > 1 │ function foo(a) { a &&= b; } │ ^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { a ||= b; } ``` # Diagnostics ``` invalid.jsonc:1:19 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { a ||= b; } │ ^ i The parameter is declared here: > 1 │ function foo(a) { a ||= b; } │ ^ i Use a local variable instead. ``` # Input ```cjs function foo(a) { a ??= b; } ``` # Diagnostics ``` invalid.jsonc:1:19 lint/style/noParameterAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Reassigning a function parameter is confusing. > 1 │ function foo(a) { a ??= b; } │ ^ i The parameter is declared here: > 1 │ function foo(a) { a ??= b; } │ ^ i Use a local variable instead. ```