"import type" from TypeScript 3.8 not recognized
See original GitHub issueAfter upgrading to TypeScript 3.8.2 I also use the new “import type” feature https://www.typescriptlang.org/docs/handbook/modules.html#importing-types. Now I’m getting a warning from import/no-duplicates.
My affected code is e.g.:
import type { Options } from 'express-rate-limit';
import rateLimit from 'express-rate-limit';
Issue Analytics
- State:
- Created 4 years ago
- Reactions:16
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >Support TypeScript 3.8 type-only imports/exports in resolve ...
Hi, using PHPStorm 2021.2.2, I do not get the auto import type feature despite having importsNotUsedAsValues set to 'error' but it only seems...
Read more >Do I need to use the "import type" feature of TypeScript 3.8 if ...
Long answer: As TypeScript 3.8 release notes say: import type only imports declarations to be used for type annotations and declarations. It ...
Read more >Announcing TypeScript 3.8 RC - Microsoft Developer Blogs
As a solution in TypeScript 3.8, we've added a new syntax for type-only imports and exports. import type { SomeThing } ...
Read more >ts-node - npm
TypeScript icon, indicating that this package has built-in type ... This error is thrown by node when a module has an unrecognized file ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
rule
import/order
also needs to considerimport type
andimport
Seems TypeScript ESLint currently (
v2.22.0
) does not have support for TypeScript 3.8 yet (>=3.2.1 <3.8.0
, https://github.com/typescript-eslint/typescript-eslint/issues/1436). Because of this, it’s not currently possible to write a test for theimport type
syntax. So I’m afraid we need to wait for the TypeScript 3.8 support for ESLint.For future reference, here’s the test I was writing:
As of these TypeScript ESLint package versions, it will produce the error: