Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[consistent-type-imports] prefer inline type import syntax #4338

Copy link
Copy link
Closed
@akphi

Description

@akphi
Issue body actions

Description

I would like to propose an extension to the existing consistent-type-imports rule. This is linked to the work done in #4237

I think it would be beneficial for people who are interested in adopting the new inline type import syntax introduced in Typescript 4.5. We can introduce a flag, for example preferInlineTypeImports?: boolean.

Like @bradzacher mentioned, it's tricky to do a fixer, so we don't need it for now, but at least a way to warn people about violation would be great.

Fail

import type { c } from './c';
import { a } from './a'; 
import type { b } from './a';

Pass

import type { c } from './c';
import { a, type b } from './a';

Let me know what you think about this. If you give me a green light, I think if I can try working on this feature.

nonoroazoro, shelimov, amanmahajan7, florian-ernst-alan, BennoDev and 50 moredzearing, service-paradis, nrgnrg, schickling, lensbart and 13 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: 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-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.