-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancement: new base rule extensionNew base rule extension required to handle a TS specific caseNew base rule extension required to handle a TS specific casegood first issueGood for newcomersGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
We need to limit only type import some packages sometimes.
For example:
When using package in user project runtimes, Like vetur, ts-loader.
Rule Details
This rule limit only type import some package within your codebase.
Options
type Options = {
packages: Array<{ name: string, reason: string }>
};
Example
Incorrect code for { packages: [{ name: 'typescript', reason: 'runtime dependency' }] }
import ts from 'typescript'
import * as ts from 'typescript'
import { findPackageConfig } from 'typescript'
correct code for { packages: [{ name: 'typescript', reason: 'runtime dependency' }] }
import type ts from 'typescript'
import type * as ts from 'typescript'
import type { findPackageConfig } from 'typescript'
brandones
Metadata
Metadata
Assignees
Labels
enhancement: new base rule extensionNew base rule extension required to handle a TS specific caseNew base rule extension required to handle a TS specific casegood first issueGood for newcomersGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin