Skip to content

fix(linter/plugins): fix :function selector class#17218

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/12-20-fix_linter_plugins_fix_function_selector_class
Dec 21, 2025
Merged

fix(linter/plugins): fix :function selector class#17218
graphite-app[bot] merged 1 commit intomainfrom
om/12-20-fix_linter_plugins_fix_function_selector_class

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 21, 2025

:function selector class was broken when part of a broader selector e.g. :function > Identifier.

Fix it by defining a proper matchClass function to pass to ESQuery.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-bug Category - Bug labels Dec 21, 2025
Copy link
Member Author

overlookmotel commented Dec 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the :function selector class which was broken when used as part of broader selectors like :function > Identifier. The fix implements a proper matchClass function for ESQuery that correctly handles case-insensitive matching of function node types.

Key changes:

  • Implemented matchesSelectorClass function to properly match :function selector class
  • Added case-insensitive handling for the :function selector in both the class matcher and selector analyzer
  • Updated test fixtures to verify both uppercase and composite selector functionality

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/oxlint/src-js/plugins/selector.ts Added matchesSelectorClass function to properly handle :function selector class matching; updated fallback to throw error for unknown node types; made selector analysis case-insensitive
apps/oxlint/test/fixtures/selector/plugin.ts Added test cases for :FUNCTION (uppercase) and :function > Identifier (composite selector)
apps/oxlint/test/fixtures/selector/output.snap.md Updated snapshot to reflect correct behavior of :FUNCTION and :function > Identifier selectors
apps/oxlint/test/compile_visitor.test.ts Added test comment verifying case insensitivity with :FunCtioN:exit
apps/oxlint/conformance/snapshot.md Conformance improvements showing no-sync rule now fully passing (220/277 rules, 28686/29765 tests)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel force-pushed the om/12-20-fix_linter_plugins_fix_function_selector_class branch from 65fd4e8 to f2800e7 Compare December 21, 2025 17:20
@overlookmotel overlookmotel self-assigned this Dec 21, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 21, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 21, 2025

Merge activity

`:function` selector class was broken when part of a broader selector e.g. `:function > Identifier`.

Fix it by defining a proper `matchClass` function to pass to ESQuery.
@graphite-app graphite-app bot force-pushed the om/12-20-fix_linter_plugins_fix_function_selector_class branch from f2800e7 to 6f753a8 Compare December 21, 2025 17:43
@graphite-app graphite-app bot merged commit 6f753a8 into main Dec 21, 2025
18 checks passed
@graphite-app graphite-app bot deleted the om/12-20-fix_linter_plugins_fix_function_selector_class branch December 21, 2025 17:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants