Skip to content

fix: unsafe report for no-lonely-if#19087

Merged
mdjermanovic merged 2 commits intoeslint:mainfrom
abrahamguo:no-lonely-if
Nov 6, 2024
Merged

fix: unsafe report for no-lonely-if#19087
mdjermanovic merged 2 commits intoeslint:mainfrom
abrahamguo:no-lonely-if

Conversation

@abrahamguo
Copy link
Copy Markdown
Contributor

@abrahamguo abrahamguo commented Nov 1, 2024

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Fixes #19033

What changes did you make? (Give an overview)

Extract some shared logic from the curly rule that also applies here.

Is there anything you'd like reviewers to focus on?

@abrahamguo abrahamguo requested a review from a team as a code owner November 1, 2024 20:39
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Nov 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@eslint-github-bot eslint-github-bot Bot added the bug ESLint is working incorrectly label Nov 1, 2024
@github-actions github-actions Bot added the rule Relates to ESLint's core rules label Nov 1, 2024
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 1, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit bb8e6bf
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6728ccc5637907000868df17

@Tanujkanti4441 Tanujkanti4441 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Nov 3, 2024
Comment thread lib/rules/utils/ast-utils.js
Copy link
Copy Markdown
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Leaving it open for a day in case anyone else wants to take a look before merging.

@mdjermanovic mdjermanovic merged commit 9db5b15 into eslint:main Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly contributor pool rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Bug: no-lonely-if has incorrect fix when nested inside parent if without BlockStatement

3 participants