π Search Terms
Binding element implicitly has an any type 7031
π Version & Regression Information
- This changed between versions 5.5.4 and 5.6.2
β― Playground Link
https://www.typescriptlang.org/play/?strictNullChecks=true&target=9&suppressImplicitAnyIndexErrors=true&ts=5.6.2&filetype=js#code/PQKhCgAIUgBAHAhgJ0QW0gbwPICMBWApgMYAuAvpANrED2AdgGYCWA5gLpQwIrpYAKKUs0QAbADwAlErWQATcQHJ8AZwaLIAH0jK19Yhu26GAVkUAaSCtLJm9VlXYA+J5RoMWrAHSI5c5sIMYgBizKKEKpzQwOCEAB7wsqSQjACu+oH0kPDIhEi5AMIebAAUmFCQlb7+mSFhEQBcWBWVrZCqDJAAvNRRrZQ9mOTgA1jkAJTNbXT0auFeorSsJR304yNAA
π» Code
/**
* @param {Object} [config]
* @param {Partial<Record<'json' | 'jsonc' | 'json5', string[]>>} [config.additionalFiles]
*/
export function prepareConfig({
additionalFiles: {
json = []
} = {}
} = {}) {
console.log(json)
}
π Actual behavior
json is errored as Binding element 'json' implicitly has an 'any[]' type.(7031) even though it's typed as string[]

π Expected behavior
No error expected, as json is typed as string[]
Additional information about the issue
This worked well in 5.5.4 but broke with upgrade to 5.6.2. It works correctly in .ts file, but breaks in .js file with JSDoc.
π Search Terms
Binding element implicitly has an any type 7031
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?strictNullChecks=true&target=9&suppressImplicitAnyIndexErrors=true&ts=5.6.2&filetype=js#code/PQKhCgAIUgBAHAhgJ0QW0gbwPICMBWApgMYAuAvpANrED2AdgGYCWA5gLpQwIrpYAKKUs0QAbADwAlErWQATcQHJ8AZwaLIAH0jK19Yhu26GAVkUAaSCtLJm9VlXYA+J5RoMWrAHSI5c5sIMYgBizKKEKpzQwOCEAB7wsqSQjACu+oH0kPDIhEi5AMIebAAUmFCQlb7+mSFhEQBcWBWVrZCqDJAAvNRRrZQ9mOTgA1jkAJTNbXT0auFeorSsJR304yNAA
π» Code
π Actual behavior
jsonis errored asBinding element 'json' implicitly has an 'any[]' type.(7031)even though it's typed asstring[]π Expected behavior
No error expected, as
jsonis typed asstring[]Additional information about the issue
This worked well in 5.5.4 but broke with upgrade to 5.6.2. It works correctly in .ts file, but breaks in .js file with JSDoc.