Tslint: ordered-imports rule doesn't sort in the same order as Organize Imports in TypeScript

Created on 24 Jul 2018  路  9Comments  路  Source: palantir/tslint

Bug Report

  • __TSLint version__: master
  • __TypeScript version__: 2.9
  • __Running TSLint via__: CLI

See https://github.com/Microsoft/TypeScript/issues/25114

TypeScript code being linted

import { foo, _bar } from 'baz';

with tslint.json configuration:

{
  "ordered-imports": true,
}

Actual behaviour

It sorts it to import { _bar, foo }, which is different to how TypeScript organises it.

Expected behaviour

No lint error.

The difference seems to be that TypeScript is normalising strings using toUpperCase where as tslint uses toLowerCase.

Accepting PRs Breaking Change Bug

Most helpful comment

We have a PR for it, it's #4064. I'd love to see this merged although personally I just forked months ago.

All 9 comments

Is there a reason this isn't being picked up? This is a feature I (and I'm guessing many others) have been waiting for for a long time.

@Timebutt it's marked as Status: Accepting PRs which means anybody is welcome to send a PR. Including you! 馃槈

I know and I'm looking to contribute, was just wondering if there might be a specific reason why this wouldn't be fixed? Implementing this will be a breaking change, forcing everybody to change code and this might not be desired. If there is nothing preventing us from fixing this, I will try my hand at implementing this for sure!

Gotcha, great!

just wondering if there might be a specific reason why this wouldn't be fixed
breaking change

Good call - adding the missing label. We can review a PR and hold off merging it until the next major version, which should be soon.

We have a PR for it, it's #4064. I'd love to see this merged although personally I just forked months ago.

So we actually have the fix, and it was just waiting for a next major version? In that case, it seems like the timing is in our favour, as a new version will be around soon right @JoshuaKGoldberg?

Correct! 馃檶

Removing the Type: Breaking Change label per #4811. Now accepting PRs!

Thx for the work !

Is the fix expected to ship in the next release ?

Was this page helpful?
0 / 5 - 0 ratings