-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed as not planned
Closed as not planned
Copy link
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Link to the rule's documentation
Description
With "importsNotUsedAsValues": "error" in tsconfig.json, those two lines behave differently.
import type { T } from "./module"; // ok
import { type T } from "./module"; // error ts(1371)While using the rule consistent-type-imports with option "fixStyle": "inline-type-imports", this plugin will yield incorrect ts code.
// before
import { T } from "./module";
// after
import { type T } from "./module"; // error ts(1371)We may need a new option or a new rule to handle the type-only imports properly.
import { type T } -> import type { T }
import { type A, type B } -> import type { A, B }
import { A, type B } -> <as-is>
import { A, B } -> <as-is>Fail
import { type T }
import { type A, type B }Pass
import type { T }
import type { A, B }
import { A, type B }
import { A, B }Additional Info
Metadata
Metadata
Assignees
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look