Skip to content

typescript organize imports conflicts with ts-lint rule ordered-imports #23888

Description

@marcelh-gh

TypeScript Version: 2.9.0-dev.201xxxxx

Search Terms: organize imports, code action

The typescript feature alphabetizes imports in a way that all imports starting with a capital letter come first.
The ts-lint rule expects everything to be alphabetized just based on the letter - irrespective of capitalization.

This gets annoying when you use the ts-lint rule and also configure the TS code action to organize imports when the file gets saved.
After you use the quick-fix in VS Code to fix issues, they just get recreated as soon as you save the file.

Activity

  1. j-oliveras commented on May 4, 2018

    @j-oliveras
    Contributor

    You can disable auto organize imports in VS Code: https://code.visualstudio.com/updates/v1_23#_run-code-actions-on-save

  2. marcelh-gh commented on May 4, 2018

    @marcelh-gh
    Author

    Jordi Oliveras Rovira (@j-oliveras) you misunderstood my point. I know that and turned it on on purpose. The point is, it would be nice if ts-lint and TS organize imports would use the same method to alphabetize. ;-)

  3. mhegazy commented on May 4, 2018

    @mhegazy
    Contributor

    looks like a duplicate of #23366. we should use case-insensitive comparison when ordering imports..

  4. added
    DuplicateAn existing issue was already created
    and removed
    BugA bug in TypeScript
    on May 4, 2018
  5. locked and limited conversation to collaborators on Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions