-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
π 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
π» 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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript