Skip to content

Commit a3be733

Browse files
committed
variable is only used within the for loop
1 parent 5ba61f7 commit a3be733

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/slang-printers/print-binary-operation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export const binaryIndentRulesBuilder =
4444
(shouldIndent: (node: BinaryOperation) => boolean) =>
4545
(path: AstPath<BinaryOperation>) =>
4646
(document: Doc): Doc => {
47-
let { node } = path;
48-
for (let i = 2; ; i += 2) {
47+
for (let i = 2, { node } = path; ; i += 2) {
4948
const grandparentNode = path.getNode(i) as StrictAstNode;
5049
if (shouldNotIndent(grandparentNode, path, i)) break;
5150
if (!isBinaryOperation(grandparentNode)) return indent(document);

src/slang-printers/print-logical-operation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const logicalGroupRulesBuilder = binaryGroupRulesBuilder(() => false);
2121
const logicalIndentRulesBuilder =
2222
(path: AstPath<BinaryOperation>, options: ParserOptions<AstNode>) =>
2323
(document: Doc): Doc => {
24-
let { node } = path;
25-
for (let i = 2; ; i += 2) {
24+
for (let i = 2, { node } = path; ; i += 2) {
2625
const grandparentNode = path.getNode(i) as StrictAstNode;
2726
if (shouldNotIndent(grandparentNode, path, i)) break;
2827
if (

0 commit comments

Comments
 (0)