Skip to content

Refactors which in TS would generate a type annotation should generate jsdoc in JS #26306

Open
@weswigham

Description

TypeScript Version: 3.1.0-dev.201xxxxx

Search Terms:

Code

// In TS
function x(): 42 {
  return /*extract to inner function*/42;
}
// In JS
// @ts-check
/**
 * @returns {42}
 */
function x() {
    return /*extract to inner function*/42;
}

Expected behavior:
Under ts-check, a refactoring should apply appropriate jsdocs to allow js to typecheck after a refactoring if it typechecked before it.

Actual behavior:
jsneedsdocs

Playground Link:

Related Issues:

Activity

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

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions