mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-13 23:48:54 -05:00
skip optional parameters in js files (#51924)
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}`,
|
||||
});
|
||||
Reference in New Issue
Block a user