Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): no-else-return fixer fails when else has no trailing whitespace #6348

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Oct 7, 2024

Fixes a bug in eslint/no_else_return's fixer where fixes were not being
property applied when else had no whitespace immediately after it. For
example:

if(x){ return x }else{ return y }

I also refactored the rule's fixer to avoid string allocations as much as
possible.

Copy link
Contributor Author

DonIsaac commented Oct 7, 2024

@github-actions github-actions bot added the A-linter Area - Linter label Oct 7, 2024
Copy link

graphite-app bot commented Oct 7, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link

codspeed-hq bot commented Oct 7, 2024

CodSpeed Performance Report

Merging #6348 will not alter performance

Comparing don/10-07-fix_linter_no_else_return_fixer_fails_when_else_has_no_trailing_whitespace (71ad5d3) with main (a1e0d30)

Summary

✅ 29 untouched benchmarks

@DonIsaac DonIsaac added the C-bug Category - Bug label Oct 7, 2024
@DonIsaac DonIsaac marked this pull request as ready for review October 7, 2024 19:49
@DonIsaac DonIsaac changed the title fix(linter): no_else_return fixer fails when else has no trailing whitespace fix(linter): no-else-return fixer fails when else has no trailing whitespace Oct 7, 2024
@DonIsaac DonIsaac added the 0-merge Merge with Graphite Merge Queue label Oct 7, 2024
Copy link

graphite-app bot commented Oct 7, 2024

Merge activity

  • Oct 7, 7:19 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 7, 7:19 PM EDT: DonIsaac added this pull request to the Graphite merge queue.
  • Oct 7, 7:24 PM EDT: DonIsaac merged this pull request with the Graphite merge queue.

… whitespace (#6348)

Fixes a bug in `eslint/no_else_return`'s fixer where fixes were not being
property applied when `else` had no whitespace immediately after it. For
example:
```js
if(x){ return x }else{ return y }
```

I also refactored the rule's fixer to avoid string allocations as much as
possible.
@DonIsaac DonIsaac force-pushed the don/10-07-fix_linter_no_else_return_fixer_fails_when_else_has_no_trailing_whitespace branch from 1ade3c3 to 71ad5d3 Compare October 7, 2024 23:19
@graphite-app graphite-app bot merged commit 71ad5d3 into main Oct 7, 2024
26 checks passed
@graphite-app graphite-app bot deleted the don/10-07-fix_linter_no_else_return_fixer_fails_when_else_has_no_trailing_whitespace branch October 7, 2024 23:24
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 C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants