--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.ts --- # Input ```ts function b(a, b, b) {} function c(a, a, a) {} const d = (a, b, a) => {}; function e(a, b, a, b) {} var f = function (a, b, b) {}; class G { ggg(a, a, a) {} } let objectMethods = { method(a, b, c, c) {} }; var h = function (a, b, a) {}; export default function (a, b, a, a) {} function f({ test: res = 3 }, res) {} export function f2(a, b, c = (a, b, b) => {}) {} class A { constructor(a, a) {} } class A { constructor(private a, a) {} } class A { constructor(a, readonly a) {} } class A { constructor(private a, private a) {} } class A { constructor(readonly a, private a) {} } ``` # Diagnostics ``` invalid.ts:1:18 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. > 1 │ function b(a, b, b) {} │ ^ 2 │ function c(a, a, a) {} 3 │ const d = (a, b, a) => {}; i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:2:15 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 1 │ function b(a, b, b) {} > 2 │ function c(a, a, a) {} │ ^ 3 │ const d = (a, b, a) => {}; 4 │ function e(a, b, a, b) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:3:18 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 1 │ function b(a, b, b) {} 2 │ function c(a, a, a) {} > 3 │ const d = (a, b, a) => {}; │ ^ 4 │ function e(a, b, a, b) {} 5 │ var f = function (a, b, b) {}; i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:4:18 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 2 │ function c(a, a, a) {} 3 │ const d = (a, b, a) => {}; > 4 │ function e(a, b, a, b) {} │ ^ 5 │ var f = function (a, b, b) {}; 6 │ class G { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:5:25 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 3 │ const d = (a, b, a) => {}; 4 │ function e(a, b, a, b) {} > 5 │ var f = function (a, b, b) {}; │ ^ 6 │ class G { 7 │ ggg(a, a, a) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:7:9 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 5 │ var f = function (a, b, b) {}; 6 │ class G { > 7 │ ggg(a, a, a) {} │ ^ 8 │ } 9 │ let objectMethods = { method(a, b, c, c) {} }; i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:9:39 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 7 │ ggg(a, a, a) {} 8 │ } > 9 │ let objectMethods = { method(a, b, c, c) {} }; │ ^ 10 │ var h = function (a, b, a) {}; 11 │ export default function (a, b, a, a) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:10:25 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 8 │ } 9 │ let objectMethods = { method(a, b, c, c) {} }; > 10 │ var h = function (a, b, a) {}; │ ^ 11 │ export default function (a, b, a, a) {} 12 │ function f({ test: res = 3 }, res) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:11:32 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 9 │ let objectMethods = { method(a, b, c, c) {} }; 10 │ var h = function (a, b, a) {}; > 11 │ export default function (a, b, a, a) {} │ ^ 12 │ function f({ test: res = 3 }, res) {} 13 │ export function f2(a, b, c = (a, b, b) => {}) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:12:31 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 10 │ var h = function (a, b, a) {}; 11 │ export default function (a, b, a, a) {} > 12 │ function f({ test: res = 3 }, res) {} │ ^^^ 13 │ export function f2(a, b, c = (a, b, b) => {}) {} 14 │ class A { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:13:37 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 11 │ export default function (a, b, a, a) {} 12 │ function f({ test: res = 3 }, res) {} > 13 │ export function f2(a, b, c = (a, b, b) => {}) {} │ ^ 14 │ class A { 15 │ constructor(a, a) {} i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:15:17 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 13 │ export function f2(a, b, c = (a, b, b) => {}) {} 14 │ class A { > 15 │ constructor(a, a) {} │ ^ 16 │ } 17 │ class A { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:18:25 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 16 │ } 17 │ class A { > 18 │ constructor(private a, a) {} │ ^ 19 │ } 20 │ class A { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:21:26 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 19 │ } 20 │ class A { > 21 │ constructor(a, readonly a) {} │ ^ 22 │ } 23 │ class A { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:24:33 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 22 │ } 23 │ class A { > 24 │ constructor(private a, private a) {} │ ^ 25 │ } 26 │ class A { i The parameter overrides a preceding parameter by using the same name. ``` ``` invalid.ts:27:34 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Duplicate parameter name. 25 │ } 26 │ class A { > 27 │ constructor(readonly a, private a) {} │ ^ 28 │ } 29 │ i The parameter overrides a preceding parameter by using the same name. ```