Skip to content

v2.23 broke alphabetical sorting #2064

@jeron-diovis

Description

@jeron-diovis

This and this changes cause the following weird effect.

With imports like this:

import React from 'react'
import { BrowserRouter } from 'react-router-dom'
...

func mutateRanksToAlphabetize produces following groups:

{
  '0.8': [ 'react-value', 'react-router-dom-value' ],
  ...
}

Then this group gets sorted alphabetically, and obviously turns into [ 'react-router-dom-value', 'react-value' ]. While normally, 'react' < 'react-router-dom' === true.

So after updating to 2.23 I suddenly have warnings about wrong imports order all over the project .

Probably, you may just use | instead of - to separate importKind from importName?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions