Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanwan committed May 2, 2024
1 parent c2d51aa commit 1294298
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/bumpgen-core/src/services/matching/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ const trimCode = (code: string) => code.split("\n").map((line) => line.trim());
export const formatNewCode = (firstMatchedLine: string, newCode: string) => {
const countIndents = (line: string) => {
let count = 0;
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < line.length; i++) {
if (line[i] === " " || line[i] === "\t") {
count++;
} else {
break;
}
for (const char of line) {
if (char === " " || char === "\t") count++;
else break;
}
return count;
};
Expand Down

0 comments on commit 1294298

Please sign in to comment.