Skip to content

More invalid JSDoc generate cases #38626

Description

TypeScript Version: 4.0.0-dev.20200516

Search Terms:: JSDoc invalid dts

Code

/** * @param {Array=} y desc */functionx(y){}/** * @param {function (Olm.InboundGroupSession)} func Invoked */functiony(func){}/** * @return {(Array.<> | null)} list of devices */functionz(){}/** *  * @return {?Promise} A promise */functionw(){}
Compiler Options
{
"compilerOptions": {
"noImplicitAny": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"checkJs": true,
"allowJs": true,
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": 2,
"target": "ES2017",
"jsx": "React",
"module": "ESNext"
}
}

Invalid outputs:

/** * @param {Array=} y desc */declarefunctionx(y?: Array|undefined): void;// ~~~~~~~~~~~~~~~~~~~~~~~~~^ Missing generics/** * @param {function (Olm.InboundGroupSession)} func Invoked */declarefunctiony(func: (arg0: any)=>): void;// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ invalid type signature/** * @return {(Array.<> | null)} list of devices */declarefunctionz(): (Array|null);// ~~~~~~~~~~~~~~~~~~~~~~~~~^ missing generics/** * * @return {?Promise} A promise */declarefunctionw(): Promise|null;// ~~~~~~~~~~~~~~~~~~~~~~~~~~^ missing generics

Playground Link:Provided

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions