-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
order exports #1888
Comments
Related to #659. In that case it's for exported members, but some people are commenting libraries that solve the exported module order issue. |
@gajus Is it fair to say your request here is limited to re-exports, aka That's all I care about personally. Given re-export syntax appears to be a subset of import syntax, it might be a far simpler request to fulfill. |
Correct. If anyone is keen to contribute, consider adding it to https://github.com/gajus/eslint-plugin-canonical |
I'd be happy to accept a PR for a new rule here. |
or that. I only suggest eslint-plugin-canonical because it is a playground to quickly release and test rules. |
Hey all, I listed all these kind of re-exports I'd like to handle (I may have forgotten some) export * from "module-name";
export * as name1 from "module-name";
export { default } from "module-name";
export { name1, /* …, */ nameN } from "module-name";
export { import1 as name1, import2 as name2, /* …, */ nameN } from "module-name";
export { default as name1 } from "module-name";
export type * from "module-name";
export type { name1 } from "module-name"; @ljharb do you imagine the exports should be grouped (same as imports) ? |
I would assume that all the same options for imports would govern exports, whenever it makes sense. |
I suggest we do a different rule, but I might move some logic around |
Super! Any ETA? 🥳 |
no idea yet, I've just started looking into it 😁 |
Surprisingly do not see an existing issue for this, but I would like to have an equivalent of
order
withalphabetize
for exports.This would esp. useful for files that only contain exports, e.g.
At the moment, these exports are in a random order.
Enforcing export order when file only contains exports would be useful.
The text was updated successfully, but these errors were encountered: