Skip to content

Organize Imports should used case-insenstive sort for imports #23366

Closed

Description

@mjbvz

From Michael Bond (@MichaelRBond) on April 12, 2018 11:23

Issue Type: Bug

When running Organize Imports on the following line: import {abc, Xyz} from "./foo"; the command changes the import sort order from
abc, Xyz to Xyz, abc. This causes a tslint error, because tslint expects it to sort alphabetically regardless of case.

Steps to reproduce:

  • Run Organize Imports

Expected Result:
sorted order of imports is the same as tslints expected sort order. import { abc, Xyz } from "./foo";

VS Code version: Code 1.22.1 (950b8b0d37a9b7061b6f0d291837ccc4015f5ecd, 2018-04-06T00:21:13.607Z)
OS version: Darwin x64 17.4.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz (8 x 2800)
Load (avg) 4, 4, 4
Memory (System) 16.00GB (1.94GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_3691397
Screen Reader no
VM 0%
Extensions (25)
Extension Author (truncated) Version
vscode-markdownlint Dav 0.14.1
todo-tree Gru 0.0.31
JSDocTagComplete Hoo 0.0.2
vscode-todo Mat 0.8.0
vscode-docker Pet 0.0.26
cform aws 0.0.10
solargraph cas 0.15.0
tslint eg2 1.0.28
json-tools eri 1.0.2
vscode-emacs hir 0.1.1
ruby-linter hoo 1.0.0
terraform mau 0.0.23
prettify-json moh 0.0.3
python ms- 2018.3.1
azure-account ms- 0.4.0
dust nem 0.0.1
Ruby reb 0.18.0
java red 0.22.0
vscode-icons rob 7.22.0
code-spell-checker str 1.6.6
vscode-java-debug vsc 0.8.0
vscode-java-pack vsc 0.3.0
vscode-java-test vsc 0.5.0
vscode-maven vsc 0.7.0
vscode-todo-highlight way 0.5.12

(1 theme extensions excluded)

Copied from original issue: microsoft/vscode#47734

Activity

  1. removed their assignment
    on Apr 12, 2018
  2. changed the title [-]Organize Imports does not alphabetically sort the same way as tslint[/-] on Apr 12, 2018
  3. added
    VS Code Tracked
    on Apr 12, 2018
  4. added
    Suggestion
    Awaiting More Feedback
    Domain: LS: Organize Imports
    on Apr 12, 2018
  5. kralcifer commented on Apr 19, 2018

    @kralcifer

    would love to see this fix.

  6. mhegazy commented on May 4, 2018

    @mhegazy
    Contributor

    This is also conflicting with an existing ts-lint rule, see #23888

  7. removed
    Awaiting More Feedback
    on May 4, 2018
  8. added
    Fixed
    on May 11, 2018
  9. 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

Labels

Domain: LS: Organize ImportsFixedSuggestionVS Code Tracked

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions