Open judblackburn opened 2 years ago
Hi @judblackburn, would you mind providing a project and/or instructions to reproduce? I haven't encountered any issues with gts fix
in my own repos, so just want to make sure we have a good env to reproduce in.
@sofisl Thanks for the quick review.
A colleague set up this example repo.
Steps to reproduce:
/gts-issue-701-example
yarn fix
The output from the yarn fix
command will indicate a parsing error in the index.ts
file and the code in index.ts
will not compile due to extra right parenthesis that gts
added.
Thanks for adding @judblackburn. I can reproduce the issue, will dig into it.
@sofisl Thanks again. I appreciate it and look forward to hearing from you.
So I'm not sure if this is related but in my case it removes an extra right parenthesis, which then leads to a parsing error. Happy to make a new issue if this is unrelated but figured I'd start here.
Here is the specific commit where the issue arose; I had to manually add back in the parenthesis on line 391. https://github.com/googleapis/google-cloudevents-nodejs/pull/134/commits/1aeda60027334390b7dae3c9cd0b0d2e4115c909#diff-5a6086473b8eb13bb4d42727ad83d0d3efb1149d251aca4e894b955b31a74d91R377
Other areas in my code also arose as a result of this, which I am still trying to figure out.
Also if I run npm run fix
again after running it the first time and correcting the missing parenthesis, I am met with this error:
Error: Command failed with exit code 1: node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern
Reproduce by cloning this PR https://github.com/googleapis/google-cloudevents-nodejs/pull/134 and checking out HEAD~1 then manually running npm run fix
Ah the actual problem created in this one is because we are using !=
somewhere and when it changes it to !==
it changes the functionality.
Summary
When running
gts fix
on this code, it adds extra)
and breaks the code.Before
gts fix
After
gts fix
output
package.json