productboardlabs / tslint-pb

📄 (DEPRECATED) Our own custom TSlint rules. What has been seen, cannot be unseen.
MIT License
5 stars 0 forks source link

Fixed special case when identifier has _ #30

Closed jukben closed 5 years ago

jukben commented 5 years ago

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 :) )!