angulartypescriptvisual-studio-codeauto-import

How to remove "type" keyword in TypeScript auto-imports?


Since a few days ago, when I auto-import something in VSCode in an Angular project, the import looks like this :

import type { JobPostingSurvey } from '@gri/interfaces';

Is it possible to remove the type keyword and go back to previous TypeScript imports?

import { JobPostingSurvey } from '@gri/interfaces';

This kind of unsuspected change really doesn't fit in an enterprise setting :/


Solution

  • This behavior only exists in the TypeScript 3.8-beta and will likely be removed before the final 3.8 release. See this issue for a discussion of the problem and proposed changes