Skip to content
New issue

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

Improve import type specifier style #24

Open
arsnl opened this issue Jul 20, 2023 · 0 comments
Open

Improve import type specifier style #24

arsnl opened this issue Jul 20, 2023 · 0 comments

Comments

@arsnl
Copy link
Owner

arsnl commented Jul 20, 2023

Currently, the import type is top level. This syntax is not optimal since it reduce the readability, locality and make refactoring a little bit more complex.

import { Foo } from "FooLib";
import { Bar } from "BarLib";
import type { FooType } from "FooLib"; // Top level type import

To improve this, TypeScript 4.5 introduce the inline type import.

import { Foo, type FooType } from "FooLib"; // Inline type import
import { Bar } from "BarLib";

To support this new syntax, Peppy will need to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant