mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
skip optional parameters in js files (#51924)
This commit is contained in:
parent
645b3ddb06
commit
193a8a74c8
@ -400,7 +400,7 @@ export function createSignatureDeclarationFromSignature(
|
||||
parameterDecl.modifiers,
|
||||
parameterDecl.dotDotDotToken,
|
||||
parameterDecl.name,
|
||||
parameterDecl.questionToken,
|
||||
isJs ? undefined : parameterDecl.questionToken,
|
||||
type,
|
||||
parameterDecl.initializer
|
||||
);
|
||||
|
||||
20
tests/cases/fourslash/codeFixAddMissingProperties26.ts
Normal file
20
tests/cases/fourslash/codeFixAddMissingProperties26.ts
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @filename: /a.js
|
||||
/////**
|
||||
//// * @type {{ f: (x?: string) => number }}
|
||||
//// */
|
||||
////[|export const foo = {}|]
|
||||
|
||||
verify.codeFix({
|
||||
index: 0,
|
||||
description: ts.Diagnostics.Add_missing_properties.message,
|
||||
newRangeContent:
|
||||
`export const foo = {
|
||||
f: function(x) {
|
||||
throw new Error("Function not implemented.");
|
||||
}
|
||||
}`,
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user