Skip to content

Rule proposal: import sorting rule which matches that of Organize Imports in TypeScript #113

Closed
@aboyton

Description

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 to import/order doesn't really both me.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions