We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
consistent-type-specifier-style
resolution-mode
In TypeScript, you can force a type import's module resolution to be either ESM or CJS with the following:
import type {Foo} from 'some-package' with {'resolution-mode': 'import'};
This is documented here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html#stable-support-resolution-mode-in-import-types
However, TypeScript only allows this when the type is top-level. In other words, this gives a compiler error:
type
import {type Foo} from 'some-package' with {'resolution-mode': 'import'}; // ^ Error: `resolution-mode` can only be set for type-only imports.
This is a problem when import-x/consistent-type-specifier-style is set to prefer-inline. The rule option shouldn't warn in this case.
import-x/consistent-type-specifier-style
prefer-inline
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In TypeScript, you can force a type import's module resolution to be either ESM or CJS with the following:
This is documented here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html#stable-support-resolution-mode-in-import-types
However, TypeScript only allows this when the
type
is top-level. In other words, this gives a compiler error:This is a problem when
import-x/consistent-type-specifier-style
is set toprefer-inline
. The rule option shouldn't warn in this case.The text was updated successfully, but these errors were encountered: