Skip to content

feat: change ESQuery Selector placeholder text based on language#104

Merged
nzakas merged 2 commits into
mainfrom
feat-change-esquery-selector-placeholder-text-based-on-language
May 14, 2025
Merged

feat: change ESQuery Selector placeholder text based on language#104
nzakas merged 2 commits into
mainfrom
feat-change-esquery-selector-placeholder-text-based-on-language

Conversation

@lumirlumir
Copy link
Copy Markdown
Member

Prerequisites checklist

What is the purpose of this pull request?

What changes did you make? (Give an overview)

Hello,

Currently, the ESQuery Selector's placeholder remains the same even when switching to a language other than JavaScript.

To improve this, I added support for updating the ESQuery Selector placeholder based on the selected language.

Now, the placeholders correctly reflect language-specific examples!

  • Before: The placeholder always showed e.g. "ImportDeclaration > Literal" regardless of the language

image

  • After: The placeholder now varies depending on the selected language

image

image

image

image

image

Related Issues

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

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2025

Deploy Preview for eslint-code-explorer ready!

Name Link
🔨 Latest commit cdccb99
🔍 Latest deploy log https://app.netlify.com/sites/eslint-code-explorer/deploys/6824759a26eec300089f7d6f
😎 Deploy Preview https://deploy-preview-104--eslint-code-explorer.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 site configuration.

Comment thread src/components/esquery-selector-input.tsx Outdated
Comment thread src/components/esquery-selector-input.tsx Outdated
@amareshsm amareshsm added the accepted There is consensus among the team that this change meets the criteria for inclusion label May 14, 2025
@lumirlumir
Copy link
Copy Markdown
Member Author

Thanks for pointing this out.

I've added a new commit cdccb99.

@lumirlumir lumirlumir requested a review from amareshsm May 14, 2025 10:52
Copy link
Copy Markdown
Member

@amareshsm amareshsm 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!

Would like to get one more review on this.

Copy link
Copy Markdown
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM.

This does, however, mean we have one more thing that needs to be updated whenever we add a new language. In a separate PR, could you please update https://github.com/eslint/code-explorer/blob/main/docs/adding-languages.md to ensure it's up-to-date with all of the required steps?

@nzakas nzakas merged commit b421c74 into main May 14, 2025
8 checks passed
@nzakas nzakas deleted the feat-change-esquery-selector-placeholder-text-based-on-language branch May 14, 2025 15:17
@lumirlumir
Copy link
Copy Markdown
Member Author

@nzakas Sure! I'll create a separate PR for this.

@lumirlumir lumirlumir mentioned this pull request Jul 30, 2025
7 tasks
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 feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants