renke / import-sort

Sort ES2015 (aka ES6) imports. Both JavaScript and TypeScript are supported.
ISC License
466 stars 73 forks source link

Don't Change Destructured Import `__` to `_` #146

Open rjhilgefort opened 3 years ago

rjhilgefort commented 3 years ago

I'm using ts-pattern and it has an export of __. This formatter changes that import and breaks my code. Any thoughts as to why and if there's a work around.

import { __, match } from 'ts-pattern'

Changes to

import { _, match } from 'ts-pattern'
rjhilgefort commented 3 years ago

Related: https://github.com/ifiokjr/prettier-plugin-sorted/issues/23

thibautsabot commented 3 years ago

It looks likes @renke added it on purpose because of a bug (see here : https://github.com/renke/import-sort/blob/master/packages/import-sort-parser-typescript/src/index.ts#L182).

When removing the function, it's working as expected. Maybe the bug isn't there anymore and the fix is the one actually causing the issue ?