Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-named-default: Should ignore type import #2130

Closed
iliubinskii opened this issue Jun 16, 2021 · 1 comment
Closed

no-named-default: Should ignore type import #2130

iliubinskii opened this issue Jun 16, 2021 · 1 comment

Comments

@iliubinskii
Copy link

Sample code:

import type { default as Vue, VueConstructor } from "vue";

Getting error:
Use default import syntax to import 'Vue'

However, this code produces typescript error:

import type Vue, { VueConstructor } from "vue";

And this code triggers import/no-duplicates rule:

import type { VueConstructor } from "vue";
import type Vue from "vue";

So, either:
A) the original code should be ignored because there is no alternative for it.
or
B) import/no-duplicates should allow the last code.

See also:
#2114

@ljharb
Copy link
Member

ljharb commented Aug 18, 2021

#2149 fixed no-duplicates; the proper thing is to use two statements (until TS fixes things so it properly accepts them in the same statement).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants