import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.
MIT License
5.45k stars 1.56k forks source link

[no-duplicates] incorrect report on two non-combinable ts type import statements #2007

Open JounQin opened 3 years ago

JounQin commented 3 years ago
import type ESLint from 'eslint'
import type { Linter, SourceCode } from 'eslint'

If I merge them into one statement:

import type ESLint, { Linter, SourceCode } from 'eslint'

TS will fail to compile

packages/eslint-plugin-mdx/src/processors/options.ts:5:8 - error TS1363: A type-only import can specify a default import or named bindings, but not both.

5 import type ESLint, { Linter, SourceCode } from 'eslint'
iliubinskii commented 3 years ago

Same issue here: import type Vue from "vue"; import type { VueConstructor } from "vue";