Skip to content

test(linter/no-useless-assignment): cover conditional for updates#23792

Merged
graphite-app[bot] merged 1 commit into
mainfrom
test/no-useless-assignment-conditional-for-update
Jun 25, 2026
Merged

test(linter/no-useless-assignment): cover conditional for updates#23792
graphite-app[bot] merged 1 commit into
mainfrom
test/no-useless-assignment-conditional-for-update

Conversation

@camc314

@camc314 camc314 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

fixes #23789

closes #23789 by adding a regression test case.

The test verifies that both branches of a conditional for update expression are considered used by the next loop iteration:

forward ? index++ : index--

Note, this was fixed via the CFG correction in #23791 - the update branches were disconnected from the loop test and incorrectly reported as useless assignments.

Stacked on #23791.

@github-actions github-actions Bot added the A-linter Area - Linter label Jun 25, 2026
@camc314 camc314 self-assigned this Jun 25, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jun 25, 2026
@graphite-app graphite-app Bot force-pushed the fix/semantic-cfg-for-update branch from af06514 to 869ac20 Compare June 25, 2026 17:26
@graphite-app graphite-app Bot requested a review from Dunqing as a code owner June 25, 2026 17:26
@codspeed-hq

codspeed-hq Bot commented Jun 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 66 skipped benchmarks1


Comparing test/no-useless-assignment-conditional-for-update (50c574e) with fix/semantic-cfg-for-update (af06514)2

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on fix/semantic-cfg-for-update (222e9f6) during the generation of this report, so 0a7ac5f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Base automatically changed from fix/semantic-cfg-for-update to main June 25, 2026 17:30

camc314 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@github-actions github-actions Bot added the A-semantic Area - Semantic label Jun 25, 2026
…3792)

fixes #23789

closes #23789 by adding a regression test case.

The test verifies that both branches of a conditional `for` update expression are considered used by the next loop iteration:

```ts
forward ? index++ : index--
```

Note, this was fixed via the CFG correction in #23791 - the update branches were disconnected from the loop test and incorrectly reported as useless assignments.

Stacked on #23791.
@graphite-app graphite-app Bot force-pushed the test/no-useless-assignment-conditional-for-update branch from 50c574e to 48c0e47 Compare June 25, 2026 17:32
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 25, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jun 25, 2026
@graphite-app graphite-app Bot merged commit 48c0e47 into main Jun 25, 2026
61 checks passed
@graphite-app graphite-app Bot deleted the test/no-useless-assignment-conditional-for-update branch June 25, 2026 17:50
camc314 added a commit that referenced this pull request Jul 3, 2026
…3792)

fixes #23789

closes #23789 by adding a regression test case.

The test verifies that both branches of a conditional `for` update expression are considered used by the next loop iteration:

```ts
forward ? index++ : index--
```

Note, this was fixed via the CFG correction in #23791 - the update branches were disconnected from the loop test and incorrectly reported as useless assignments.

Stacked on #23791.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-linter Area - Linter A-semantic Area - Semantic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eslint/no-useless-assignment false positive for conditional for-loop update expression

1 participant