Skip to content

isolatedDeclaration omits import of type used in key of mapped type #4020

@MichaelMitchell-at

Description

@MichaelMitchell-at

Tested version: 0.16.3

require('oxc-transform').isolatedDeclaration('hello.ts', `
    import { type Foo } from '.';
    
    export type Bar = Partial<{ [K in Foo] : boolean}>;
`)
{
  sourceText: 'export type Bar = Partial<{ [K in Foo] : boolean}>;\n',
  errors: []
}

Expected:

import { type Foo } from '.'
export type Bar = Partial<{ [K in Foo] : boolean}>;

Actual:

export type Bar = Partial<{ [K in Foo] : boolean}>;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions