fix(linter/plugins): fix :function selector class#17218
fix(linter/plugins): fix :function selector class#17218graphite-app[bot] merged 1 commit intomainfrom
:function selector class#17218Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this comment.
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
matchesSelectorClassfunction to properly match:functionselector class - Added case-insensitive handling for the
:functionselector 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.
65fd4e8 to
f2800e7
Compare
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.
f2800e7 to
6f753a8
Compare

:functionselector class was broken when part of a broader selector e.g.:function > Identifier.Fix it by defining a proper
matchClassfunction to pass to ESQuery.