Skip to content

fix: correctly guard "Fix All" when no fixable messages#1004

Open
amareshsm wants to merge 1 commit intomainfrom
bug-fix-fixAll
Open

fix: correctly guard "Fix All" when no fixable messages#1004
amareshsm wants to merge 1 commit intomainfrom
bug-fix-fixAll

Conversation

@amareshsm
Copy link
Copy Markdown
Member

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What is the purpose of this pull request?

Fixes a logic bug in the playground's "Fix All" action so it correctly detects when there are no auto-fixable ESLint messages and returns early. Previously the guard was ineffective, causing an unnecessary call to linter.verifyAndFix() on every click even when nothing was fixable.

What changes did you make? (Give an overview)

Updated app.jsx: replaced the truthiness check on the filtered array with a length check:
Before

 if (!hasFixableMessages) { return; }

After:

if (!hasFixableMessages.length) { return; }

Related Issues

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

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Apr 16, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Apr 16, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/fr-eslint/deploys/69e14743e840440008f48516
😎 Deploy Preview https://deploy-preview-1004--fr-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for new-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/new-eslint/deploys/69e14743033a60000875297a
😎 Deploy Preview https://deploy-preview-1004--new-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/zh-hans-eslint/deploys/69e1474372351b0008d3aa95
😎 Deploy Preview https://deploy-preview-1004--zh-hans-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/es-eslint/deploys/69e14743e4899e0008e7170c
😎 Deploy Preview https://deploy-preview-1004--es-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/ja-eslint/deploys/69e1474302a2ab0008697524
😎 Deploy Preview https://deploy-preview-1004--ja-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/pt-br-eslint/deploys/69e14743e5326a000899e347
😎 Deploy Preview https://deploy-preview-1004--pt-br-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/de-eslint/deploys/69e14743c5ab890008f2e281
😎 Deploy Preview https://deploy-preview-1004--de-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 2616af8
🔍 Latest deploy log https://app.netlify.com/projects/hi-eslint/deploys/69e1474345888300087bc035
😎 Deploy Preview https://deploy-preview-1004--hi-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/playground/app.jsx
@@ -252,7 +252,7 @@ const App = () => {

const onFixAll = () => {
const hasFixableMessages = messages.filter(message => message.fix);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As this is a boolish context, I think we rather should use .some instead of .filter (and not use the .length property).

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

Labels

bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants