Skip to content

@typescript-eslint/explicit-function-return-type fails with JSDoc @returns annotation #906

@jens-duttke

Description

@jens-duttke

I'm using JSDoc annomations to tell TypeScript the type of arguments/return values/variables, which works just great. But with the update to @typescript-eslint/parser version 2.0.0 I'm getting hundreds of "Missing return type on function" errors, which is wrong, because all my functions have a return type defined in the JSDoc comment (which is used by TypeScript).

What code were you trying to parse?

/**
 * @returns {string}
 */
function xyz () {
	return 'xyz';
}

console.log(xyz);

What did you expect to happen?

I expected that the JSDoc @returns annotation is considered.

What actually happened?

The JSDoc @returns annotation is not considered.

Versions

package version
@typescript-eslint/parser 2.0.0
TypeScript 3.5.3
ESLint 6.2.2
node 10.5.0
npm 6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy