We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d9c2d8 commit 720e3bbCopy full SHA for 720e3bb
src/run-prettier.ts
@@ -116,15 +116,15 @@ export async function runPrettier(
116
{ cwd: directory },
117
);
118
119
- // Remove the useless head
120
const lines = diff.split("\n");
121
- for (let lineIndex = lines.length - 1; lineIndex > 0; lineIndex--) {
+ for (let lineIndex = lines.length - 1; lineIndex >= 0; lineIndex--) {
122
if (
123
lines[lineIndex].startsWith("diff --git Original|") &&
124
lines[lineIndex + 1].startsWith("index ") &&
125
lines[lineIndex + 2].startsWith("--- Original|http://github.com/") &&
126
lines[lineIndex + 3].startsWith("+++ Alternative|")
127
) {
+ // Remove the useless head
128
lines.splice(lineIndex, 2);
129
}
130
0 commit comments