feat(linter): add schema for node/callback-return#23039
Conversation
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
2ac9af7 to
f4b0dbf
Compare
There was a problem hiding this comment.
Pull request overview
Adds a verified JSON schema for the node/callback-return rule so it can be included in the generated configuration schema and downstream website/TS artifacts.
Changes:
- Adds a
CallbackReturnschema definition and wires upnode/callback-returnin the generated configuration schema/snapshots. - Updates ruledocs schema generation logic to better handle certain array-shaped rule schemas.
- Removes
node/callback-returnfrom the “no verified valid schema” skip list and updates generated TS config typings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/website_linter/src/snapshots/schema_json.snap | Snapshot update for the published configuration JSON schema. |
| npm/oxlint/configuration_schema.json | Adds CallbackReturn definition and updates node/callback-return rule schema. |
| crates/oxc_linter/src/utils/schemars.rs | Removes node/callback-return from the skip list for schema generation. |
| crates/oxc_linter/src/config/rules.rs | Adjusts schema generation logic for rule config arrays (severity prefixing, subschema handling). |
| apps/oxlint/src-js/package/config.generated.ts | Updates generated TS interface for node/callback-return config shape. |
f4b0dbf to
732b100
Compare
| if let Some(array) = obj.array { | ||
| let array_schema = match array.items.as_ref() { | ||
| // Tuple-style config (e.g. [Mode3, InitDeclarationsConfig]) | ||
| // should become [AllowWarnDeny, Mode3, InitDeclarationsConfig]. | ||
| Some(SingleOrVec::Vec(_)) => { | ||
| prepend_severity_to_array_schema(*array, r#gen) | ||
| } | ||
| // List-style config (e.g. string[]) should stay as a single option | ||
| // after severity: [AllowWarnDeny, string[]]. | ||
| _ => wrap_with_severity_and_single_option( | ||
| Schema::Object(SchemaObject { | ||
| instance_type: Some(InstanceType::Array.into()), | ||
| array: Some(array), | ||
| ..Default::default() | ||
| }), | ||
| r#gen, | ||
| ), | ||
| }; | ||
| return with_toggle_schema(array_schema, r#gen); | ||
| } |
732b100 to
7353446
Compare
8397d7b to
ae7633a
Compare
7353446 to
200a59a
Compare
ae7633a to
e1177e3
Compare
e1177e3 to
8713e1a
Compare
200a59a to
88015a6
Compare

No description provided.