auto-npm-install icon indicating copy to clipboard operation
auto-npm-install copied to clipboard

regex doesn't work for any of the imports I've tried

Open capaj opened this issue 6 years ago • 5 comments

this regex:

https://github.com/moshfeu/auto-npm-install/blob/eaf72d29b6e8dfb609bae79af4a5a97b20e121d7/src/import-checker-code-action.ts#L26

always just gives me null

capaj avatar Dec 08 '18 01:12 capaj

What is the import statement you try?

moshfeu avatar Dec 09 '18 06:12 moshfeu

image

capaj avatar Dec 09 '18 10:12 capaj

you know semicolons are optional in JS :wink: ?

capaj avatar Dec 09 '18 10:12 capaj

Works for me:

screen shot 2018-12-09 at 6 54 55 pm screen shot 2018-12-09 at 6 55 31 pm

I'm agree about the semicolons 👍

moshfeu avatar Dec 09 '18 16:12 moshfeu

BTW import statements can be written on multiple lines too:

import {
  a,
  b
} from 'c';

the current regex solution will fail with that too

capaj avatar Dec 09 '18 17:12 capaj