question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to extract all of the type-only imports as a separate group

See original GitHub issue

Hi!

Thank you for your nice plugin and all of the effort you’ve put in it!

What makes it distinctive from other plugins for sorting imports is handling the type-only imports (import type syntax). It would be really amazing, if your plugin enabled extracting all of that type-only imports into a separate group - in case of big projects it would really facilitate organizing imports. Or at least - if it would have an option to put all of the type-only imports at the beginning of specified groups. I hope you will consider my suggestion 😃

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lydellcommented, Dec 8, 2020

Released in v7.0.0. Thanks for all the help!

2reactions
lydellcommented, Dec 7, 2020

I’ve published 7.0.0-beta.1 with support for choosing where type imports go. Type imports have \u0000 at the end (similar to how side effect import have \u0000 at the beginning).

You should be able to use something like this:

{
  "groups": [
    ["^[^@.].*\\u0000$", "^[^/.]"],
    ["^@polkadot.*\\u0000$", "^@polkadot"],
    ["^\\..*\\u0000$", "^\\."]
  ]
}

Could you try it out?

Read more comments on GitHub >

github_iconTop Results From Across the Web

type-only imports — A new TypeScript feature that benefits ...
This allows you to use Babel for all of its benefits, while still being able to feed it ts files. Babel is going...
Read more >
Do I need to use the "import type" feature of TypeScript 3.8 if ...
Short answer: Being more explicit by using import type and export type statements seem to yield explicable benefits by safeguarding against ...
Read more >
Python import: Advanced Techniques and Tips
Organize imports into groups: first standard library imports, then third-party imports, and finally local application or library imports.
Read more >
Documentation - Modules - TypeScript
Modules import one another using a module loader. ... module can wrap one or more modules and combine all their exports using export...
Read more >
Export or import data to another file format - Microsoft Support
To export specific project information, type or select the field that you want in the From column, and then press ENTER. To add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found