Skip to content

TSLint named-imports-order and ESLint sort-imports don't order special chars (_) the same as organizeImports #37548

Closed
@snebjorn

Description

@snebjorn

TypeScript Version: 3.8.3

Search Terms:

  • named-imports-order organizeImports
  • named-imports-order

Code

// ordered using vscode organizeImports
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';

// ordered using tslint "named-imports-order": "case-insensitive" (this is the default)
// also tried "lowercase-first" and "lowercase-last" - it's worse
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';

Expected behavior:
They should sort _ the same.

Actual behavior:
TSLint seems to put _ first while organizeImports put it last. This is probably a general issue for non-alpha chars.

ESLint sort-imports also sorts special chars first.
Valid ESLint import order
Invalid ESLint import order

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions