Skip to content

Move to file does not include namespace imports #35591

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#86479

TypeScript Version: 3.8.0-dev.20191207

Search Terms:

  • refactor
  • namespace import
  • move to new file

Repo

  1. git clone https://github.com/johnpapa/vscode-import-bug.git
  2. run npm install
  3. open index.ts
  4. use a quick action to move the createComment function to a new file

Bug:
New file is missing an import for Octokit

import { IssuesCreateCommentParams } from '@octokit/rest';
export async function createComment(comment: IssuesCreateCommentParams) {
  const octokit = new Octokit({ auth: 'somevalue' });
  const response = await octokit.issues.createComment(comment);
  return response;
}

In index.ts, octokit was imported as a namespace:

import * as Octokit from '@octokit/rest';

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptRescheduledThis issue was previously scheduled to an earlier milestoneVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions