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

Feature: (sort-exports): Allow sorting type exports after general exports #273

Closed
2 tasks done
tetarchus opened this issue Sep 14, 2024 · 0 comments · Fixed by #274
Closed
2 tasks done

Feature: (sort-exports): Allow sorting type exports after general exports #273

tetarchus opened this issue Sep 14, 2024 · 0 comments · Fixed by #274
Labels
enhancement New feature or request

Comments

@tetarchus
Copy link

What rule do you want to change?

sort-exports

Describe the problem

When exporting from a React component, we often prefer exporting non-type exports first, and with the type exports at the bottom. e.g:

export { MapMarker };
export { BOUNDS_PADDING } from "./utils";
export type { MapMarkerProps } from "./prop.types";

Currently the type identifier is essentially ignored, and the rule requests that it is moved above the general export statements if the filename should come before.

I propose adding a new option to allow sorting of export type exports independently of export, similarly to #114 which allows sorting of named exports by type indentifier.

Code example

export { MapMarker };
export { BOUNDS_PADDING } from "./utils";
export type { MapMarkerProps } from "./prop.types";

Additional comments

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@tetarchus tetarchus added the enhancement New feature or request label Sep 14, 2024
hugop95 pushed a commit to hugop95/eslint-plugin-perfectionist that referenced this issue Sep 14, 2024
hugop95 pushed a commit to hugop95/eslint-plugin-perfectionist that referenced this issue Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant