Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Bugfix --project with --fix #2864

Merged
merged 5 commits into from Jun 19, 2017
Merged

Bugfix --project with --fix #2864

merged 5 commits into from Jun 19, 2017

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Jun 2, 2017

PR checklist

Overview of change:

A Program is immutable. Hence it was never updated when applying fixes. The following fixes for the same file were applied at the wrong location.

Now we update the Program (create a new one) after every fix.
[bugfix] Avoid overlapping fixes when using --project and --fix
Fixes: #2862
Fixes: #2641
Fixes: #2326
Fixes: #2877

Is there anything you'd like reviewers to focus on?

The implementation assumes that the program has been created with the default Host. That may not be the case if tslint is used as a library and the program is passed from outside. We would need a new API to get that working. That's tracked by microsoft/TypeScript#16217

CHANGELOG.md entry:

this.slow(4000);
this.timeout(6000);
fs.writeFileSync("test/files/project-multiple-fixes/testfile.test.ts",
fs.readFileSync("test/files/project-multiple-fixes/before.test.ts", "utf-8"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably use some better infrastructure so all this juggling isn't required. but this is fine for now.

@adidahiya
Copy link
Contributor

@ajafff could you resolve the merge conflicts please?

@ajafff
Copy link
Contributor Author

ajafff commented Jun 18, 2017

@adidahiya done, resolved merge conflicts and fixed new lint errors

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants