Skip to content

Compiler should rewrite namespaced types found in JSDoc #8120

Closed
@evmar

Description

@evmar

Consider input code like:

import {Foo} from './foo';

/**
 * @type {Foo}
 */
var foo = new Foo();

TypeScript imports the module under a generated name (foo_1 when I tried it), producing code like:

    /**
     * @type {Foo}
     */
    var foo = new foo_1.Foo();

But now the JSDoc refers to a type that doesn't exist -- it should instead say @type {foo_1.Foo}. (Another way they could match is if the import created a new variable Foo instead of using foo_1.Foo everywhere.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Out of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions