Open
Description
π Search Terms
js, function, parameter, destructure, required
π Version & Regression Information
- This changed between versions 5.6 and latest nightly
- We use ts 5.5 no this issue, after upgrade this issue occur.
β― Playground Link
π» Code
// utils.js
export const getUserProfileByUsername = ({
username,
withEmail = false,
withNotificationSettings = false,
} = {}) => {
return {};
};
// main.ts
import { getUserProfileByUsername } from './utils';
getUserProfileByUsername({
username: 'ly',
});
π Actual behavior
src/main.ts:4:3 - error TS2353: Object literal may only specify known properties, and 'username' does not exist in type '{ withEmail?: boolean | undefined; withNotificationSettings?: boolean | undefined; }'.
4 username: 'ly',
~~~~~~~~
Found 1 error in src/main.ts:4
π Expected behavior
no ts validate error
Additional information about the issue
ts 5.x not this issue, must be introduced by 5.6