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

Support for newlines-between-types? #234

Open
gBasil opened this issue Mar 1, 2025 · 1 comment
Open

Support for newlines-between-types? #234

gBasil opened this issue Mar 1, 2025 · 1 comment

Comments

@gBasil
Copy link

gBasil commented Mar 1, 2025

It is an option for the order rule:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#newlines-between-types


Also, I was curious what the performance difference between is this package and the original, and what things are faster. I only want to do import sorting, so I was wondering if there are any performance improvements to that in this package, or if there wouldn't be much of a difference.

@gBasil
Copy link
Author

gBasil commented Mar 1, 2025

Looking at that property again, it seems I misunderstood what it does. What I wanted is for the order rule to sort types like I specify in groups, put types at the top, with a newline separating them from the other imports, and disallowing newlines anywhere else, like so:

import type foo from 'foo';
import type { bar } from 'bar';

import foo from 'foo';
import { bar } from 'bar';
import { baz, bazLegacy } from 'baz';

The rule doesn't seem to do this, and I don't know if it's possible to do this with the current configuration options.

So what I'm asking for is for this behavior, rather than that of newlines-between-types.

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