Typescript-eslint: Support import ordering to match that of Organize Imports in TypeScript

Created on 21 Jan 2019  路  1Comment  路  Source: typescript-eslint/typescript-eslint

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 https://github.com/palantir/tslint/issues/4063 and https://github.com/aboyton/tslint/commit/fa78d7ce1f9391e2cdce2bbc6e94551ef26bedf8).

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.

new plugin rule eslint-plugin

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings