Skip to content

feat(linter/plugins): support more selector classes in visitor#17219

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

feat(linter/plugins): support more selector classes in visitor#17219
graphite-app[bot] merged 1 commit intomainfrom
om/12-20-feat_linter_plugins_support_more_selector_classes_in_visitor

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 21, 2025

We already supported :function class selector, but no others.

Add support for all the classes that ESLint supports: :statement, :declaration, :pattern, :expression.

This fixes 260 conformance tests.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-ast-tools Area - AST tools A-linter-plugins Area - Linter JS plugins C-enhancement Category - New feature or request 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 extends selector class support in the oxlint visitor system, adding support for :statement, :declaration, :pattern, and :expression selector classes. Previously, only the :function class was supported. This enhancement enables the padding-line-between-statements rule to work correctly, fixing 260 conformance tests.

Key Changes

  • Refactored the selector class tracking from a simple list to a structured SelectorClasses struct in the Rust code generator
  • Generated type ID arrays for all selector classes in the TypeScript side
  • Updated the matchesSelectorClass function to handle all selector classes with proper ESLint-compatible logic
  • Added special handling for Identifier nodes in MetaProperty contexts

Reviewed changes

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

Show a summary per file
File Description
tasks/ast_tools/src/generators/estree_visit.rs Added SelectorClasses struct to track and generate type IDs for all selector classes; removed hardcoded function type names
apps/oxlint/src-js/plugins/selector.ts Implemented complete matchesSelectorClass function with all selector classes; added imports for new type ID constants
apps/oxlint/src-js/generated/type_ids.ts Generated exports for statement, declaration, pattern, and expression type ID arrays
apps/oxlint/test/fixtures/selector/* Added test cases covering the new selector classes
apps/oxlint/test/compile_visitor.test.ts Added comprehensive test validating all selector classes
apps/oxlint/conformance/snapshot.md Updated to reflect 260 fewer failing 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 force-pushed the om/12-20-feat_linter_plugins_support_more_selector_classes_in_visitor branch from 9218edb to 53e4c8b 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

We already supported `:function` class selector, but no others.

Add support for all the classes that ESLint supports: `:statement`, `:declaration`, `:pattern`, `:expression`.

This fixes 260 conformance tests.
@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 force-pushed the om/12-20-feat_linter_plugins_support_more_selector_classes_in_visitor branch from 53e4c8b to 33b4e63 Compare December 21, 2025 17:44
Base automatically changed from om/12-20-fix_linter_plugins_fix_function_selector_class to main December 21, 2025 17:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 21, 2025
@graphite-app graphite-app bot merged commit 33b4e63 into main Dec 21, 2025
19 checks passed
@graphite-app graphite-app bot deleted the om/12-20-feat_linter_plugins_support_more_selector_classes_in_visitor branch December 21, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants