import-sort icon indicating copy to clipboard operation
import-sort copied to clipboard

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

Open rjhilgefort opened this issue 3 years ago • 2 comments

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 avatar Aug 12 '21 21:08 rjhilgefort

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

rjhilgefort avatar Aug 12 '21 21:08 rjhilgefort

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 ?

thibautsabot avatar Sep 07 '21 19:09 thibautsabot