-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 3.9.2
Search Terms:
Annotate with type from JSDocs, JSDocs, @template, multiple @template values, line breaks between generics
Expected behavior:
Generates a comma and a space between generics when click on "Annotate with type from JSDocs" and has multiple @template values.
/**
* @typedef Either
* @template L, R
*/
/**
* @param {function(R): boolean} predicate
* @param {function(R): L} onLeft
* @returns {function(R): Either.<L, R>}
* @template L, R
*/
function fromPredicate<L, R>(predicate: (arg0: R) => boolean, onLeft: (arg0: R) => L): (arg0: R) => Either<L,R> {}
Actual behavior:
Generates a line break between generics when click on "Annotate with type from JSDocs" and has multiple @template values.
/**
* @typedef Either
* @template L, R
*/
/**
* @param {function(R): boolean} predicate
* @param {function(R): L} onLeft
* @returns {function(R): Either.<L, R>}
* @template L, R
*/
function fromPredicate<L
R>(predicate: (arg0: R) => boolean, onLeft: (arg0: R) => L): (arg0: R) => Either<L,R> {}
Related Issues:
I coudn't find a similar issue.
Code
/**
* @typedef Either
* @template L, R
*/
/**
* @param {function(R): boolean} predicate
* @param {function(R): L} onLeft
* @returns {function(R): Either.<L, R>}
* @template L, R
*/
function fromPredicate(predicate, onLeft) {}
Output
"use strict";
/**
* @typedef Either
* @template L, R
*/
/**
* @param {function(R): boolean} predicate
* @param {function(R): L} onLeft
* @returns {function(R): Either.<L, R>}
* @template L, R
*/
function fromPredicate(predicate, onLeft) { }
Compiler Options
{
"compilerOptions": {
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": 2,
"target": "ES2017",
"jsx": "React",
"module": "ESNext"
}
}
Playground Link: Provided
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this