-
Notifications
You must be signed in to change notification settings - Fork 887
fix on grouped-import is deleting export statement #4569
Comments
Note that it actually deletes any code that isn't an |
Ran this on a big codebase and it deleted a ton of code. What is the expected behavior here? tslint could:
|
@lukeautry option 2 would be great, if anyone is considering tackling this bug. // cc @abierbaum, in case he has seen this issue after submitting the initial implementation of this feature |
@adidahiya See #4583 - not Solution 2 as described above, but I think it's a pretty non-invasive solution that stops the bleeding til a more robust solution can be worked on. |
@JoshuaKGoldberg Any chance you can take a look at the PR for this? |
Noticed there was already a bug for this after creating a repro. In case it helps (and maybe to check if a fix also works in this case), here's a pretty minimal repro, instructions in readme: |
@jeysal There's already a fix merged in for this, but I don't think there's been a new release for the |
@lukeautry Thanks for the fix. Sorry the code didn't work as it should have. @adidahiya I didn't see anything like this in my testing with our codebase, but now looking at it I remember thinking to myself that it seemed odd how the original code was doing the fixes. I probably slipped in a regression due to some confusion in that part of the code. I would love to see something that could do Option 2 above, but I don't see an easy way to do this off hand. :( |
Sorry, didn't take a look at the PR. Should perhaps close this then |
Indeed, #4583 should have fixed this. Please open a new issue to restart discussions & version information if it pops up again after the next release! |
Bug Report
npx tslint -p tsconfig.json
TypeScript code being linted
with
tslint.json
configuration:Actual behavior
Error on running tslint:
That is expected. But...
It removed my export statement. This is what
--fix
didExpected behavior
The text was updated successfully, but these errors were encountered: