Skip to content

feat(linter): add schema for node/callback-return#23039

Closed
Sysix wants to merge 1 commit into
graphite-base/23039from
06-06-feat_linter_add_schema_for_node_callback-return_
Closed

feat(linter): add schema for node/callback-return#23039
Sysix wants to merge 1 commit into
graphite-base/23039from
06-06-feat_linter_add_schema_for_node_callback-return_

Conversation

@Sysix

@Sysix Sysix commented Jun 6, 2026

Copy link
Copy Markdown
Member

No description provided.

Sysix commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of 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.

@codspeed-hq

codspeed-hq Bot commented Jun 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing 06-06-feat_linter_add_schema_for_node_callback-return_ (88015a6) with 06-03-feat_liter_add_schema_for_simple_rule_configurations (8713e1a)

Open in CodSpeed

Footnotes

  1. 61 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_node_callback-return_ branch from 2ac9af7 to f4b0dbf Compare June 6, 2026 19:02
@Sysix Sysix requested a review from Copilot June 6, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 CallbackReturn schema definition and wires up node/callback-return in the generated configuration schema/snapshots.
  • Updates ruledocs schema generation logic to better handle certain array-shaped rule schemas.
  • Removes node/callback-return from 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.

Comment thread tasks/website_linter/src/snapshots/schema_json.snap
Comment thread apps/oxlint/src-js/package/config.generated.ts Outdated
Comment thread crates/oxc_linter/src/config/rules.rs
Comment thread npm/oxlint/configuration_schema.json Outdated
@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_node_callback-return_ branch from f4b0dbf to 732b100 Compare June 6, 2026 19:34
@Sysix Sysix requested a review from Copilot June 6, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines +612 to 631
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);
}
@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_node_callback-return_ branch from 732b100 to 7353446 Compare June 6, 2026 19:49
@graphite-app graphite-app Bot force-pushed the 06-03-feat_liter_add_schema_for_simple_rule_configurations branch 2 times, most recently from 8397d7b to ae7633a Compare June 6, 2026 21:26
@graphite-app graphite-app Bot force-pushed the 06-06-feat_linter_add_schema_for_node_callback-return_ branch from 7353446 to 200a59a Compare June 6, 2026 21:26
@graphite-app graphite-app Bot force-pushed the 06-03-feat_liter_add_schema_for_simple_rule_configurations branch from ae7633a to e1177e3 Compare June 6, 2026 21:40
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants