-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Rule proposal: import sorting rule which matches that of Organize Imports in TypeScript #113
Comments
Seems related to #256 |
I have the same issue and I'm currently using Does anyone have working rules/plugins that can suggest here that might help other people? |
We've been using As much as I would love to have an aligned-to-TypeScript auto-fixing import sorting rule in typescript-eslint, we really don't have the maintainer bandwidth to take on that surprisingly large rule. |
Yeah I think that it's not something we're going to work on - there are plenty of other import sorting rules out there and I don't think adding another one to the pile really helps the ecosystem, esp when we would have to take on the maintenance burden of keeping it in-sync with the TS implementation for the user's installed version. I'm happy to close this. |
👍 |
For those who want to have this feature anyway: I'm using https://www.npmjs.com/package/prettier-plugin-organize-imports |
TypeScript has a wonderful feature "Organise Imports". To ensure that everyone orders imports the same way it's great to also have this as a lint rule as well (rather than someone reformatting the file who has "organise imports" turned on in their editor).
The TSLint rule
ordered-imports
can almost be configured to support this ordering (there's a bug with the differences between.toUpperCase
and.toLowerCase
see palantir/tslint#4063 and aboyton/tslint@fa78d7c).Maybe I'm just incompetent, but I couldn't get
import/order
as suggested in https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md#style to order things in the same order as TypeScript's "Organise Imports" feature.It would be great to have a rule that orders in this order (which is basically case-insensitive by doing
x.toUpperCase
). Whether this comes from making a new rule or adding an option toimport/order
doesn't really both me.The text was updated successfully, but these errors were encountered: