Skip to content

Conversation

camchenry
Copy link
Member

@camchenry camchenry commented Sep 22, 2025

This is an initial pass at supporting rule configurations in headless mode. We currently do not pass any options along, but this allows passing an options field in the headless payload with each rule which will get serialized and pass along to the rule. We will need to be careful about how we handle the configs and validate the input coming in. However, this should be a backwards compatible change since it only adds a new field to the existing payload.

I believe we'll need to update each rule to allow getting valid options from an arbitrary map type.

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label 0-merge to this PR to add it to 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.

@camchenry camchenry force-pushed the 09-21-feat_add_support_for_headless_rule_config branch from 2cf63f8 to ce0891b Compare September 22, 2025 04:03
@camchenry camchenry force-pushed the 09-21-feat_add_support_for_headless_rule_config branch from a943347 to 083a2ae Compare September 22, 2025 04:22
@camchenry
Copy link
Member Author

@camc314 I'd appreciate your early thoughts on this direction. I'd love to find a way to avoid rewriting every rule to be compatible with accepting JSON input.

@camchenry
Copy link
Member Author

Sorry @auvred I should have pinged you too last night! You're much more familiar with Go than I am, so perhaps there is a more idiomatic way of handling this. With the current approach, we would need to manually (or have AI) write a function for every rule that allows accepting any and checks if it's a map of some kind, or an exact match for the rule options. Would be a decent chunk of work, but if it's necessary, then I guess that's what we need to do. 🤷

@auvred
Copy link
Collaborator

auvred commented Sep 24, 2025

As stated in #51 (comment), the main issue is that Go structs don't allow expressing typescript-eslint options one-to-one. If I were doing this, I'd write (or try to find) a Go code generator that takes typescript-eslint meta.schema (JSON Schema) and generates a small, interface-based typed deserializer for each rule.

@osdiab
Copy link

osdiab commented Oct 18, 2025

Is there any update on progress towards the go struct/typescript-eslint option mapping? don't want to be pushy, just really looking forward to this so we can give it a spin! Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants