Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Fixed special case when identifier has _ #30

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

jukben
Copy link
Contributor

@jukben jukben commented Apr 11, 2019

The regex for named imports

/{(([a-zA-Z0-9]*[, ]?)*)}/;

is wrong. Identifier could be also with _ thus in that case it gets stuck (because it can't reach } ).

Correct is

/{(([a-zA-Z0-9_]*[, ]?)*)}/;

which is basically

/{((\w*[, ]?)*)}/;

but it's still unnecessary complex, simple {(.*)} should do the trick (and it does :) )!

@jukben jukben requested a review from mauricekleine April 11, 2019 16:06
@jukben jukben merged commit b5579cf into master Apr 11, 2019
@Aldredcz Aldredcz deleted the fix/sorted-imports-underscore-bug branch April 29, 2019 18:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant