Skip to content

fix(oxlint,oxfmt): Omit useless | null for Option<T> field from schema#20273

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-12-fix_oxlint_oxfmt_omit_useless_null_from_schema
Mar 12, 2026
Merged

fix(oxlint,oxfmt): Omit useless | null for Option<T> field from schema#20273
graphite-app[bot] merged 1 commit intomainfrom
03-12-fix_oxlint_oxfmt_omit_useless_null_from_schema

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Mar 12, 2026

Currently, fields defined as key: Option<T> are represented in TS as key?: T | null.

However, passing null actually just treats it as None, which only creates noise.

Copilot AI review requested due to automatic review settings March 12, 2026 07:04
@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-formatter Area - Formatter A-linter-plugins Area - Linter JS plugins labels Mar 12, 2026
Copy link
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.

@github-actions github-actions bot added the C-bug Category - Bug label Mar 12, 2026
@leaysgur leaysgur changed the title fix(oxlint,oxfmt): Omit useless '| null' from schema fix(oxlint,oxfmt): Omit useless | null for Option<T> field from schema Mar 12, 2026
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

Updates the generated JSON schemas (and downstream generated TS config typings) for oxlint and oxfmt to stop emitting | null / type: ["…","null"] for Option<T>-backed fields, reducing schema noise and tightening editor validation.

Changes:

  • Switch schema generation to a custom schemars generator with option_add_null_type = false.
  • Regenerate website snapshot schemas and published npm configuration_schema.json files to remove null from many option types.
  • Regenerate config.generated.ts typings to drop | null from many optional config fields.

Reviewed changes

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

Show a summary per file
File Description
tasks/website_common/src/schema_json.rs Changes schema generation settings to omit null types for Option<T> fields.
tasks/website_linter/src/snapshots/schema_json.snap Updates linter schema snapshot output to match new generation behavior.
tasks/website_formatter/src/snapshots/schema_json.snap Updates formatter schema snapshot output to match new generation behavior.
npm/oxlint/configuration_schema.json Updates published oxlint JSON schema to omit null types in many places.
npm/oxfmt/configuration_schema.json Updates published oxfmt JSON schema to omit null types in many places.
apps/oxlint/src-js/package/config.generated.ts Updates generated TS types/docs to remove `
apps/oxfmt/src-js/config.generated.ts Updates generated TS types to remove `

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

aren't all these files generated? How come the generated code no longer incudes | null

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

ah I missed the rust change

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
Copy link
Contributor

camc314 commented Mar 12, 2026

Merge activity

…chema (#20273)

Currently, fields defined as `key: Option<T>` are represented in TS as `key?: T | null`.

However, passing `null` actually just treats it as `None`, which only creates noise.
@graphite-app graphite-app bot force-pushed the 03-12-fix_oxlint_oxfmt_omit_useless_null_from_schema branch from a509714 to bc20217 Compare March 12, 2026 09:48
@graphite-app graphite-app bot merged commit bc20217 into main Mar 12, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 03-12-fix_oxlint_oxfmt_omit_useless_null_from_schema branch March 12, 2026 09:59
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
graphite-app bot pushed a commit that referenced this pull request Mar 12, 2026
# Oxlint
### 🐛 Bug Fixes

- 6b46ce8 oxlint: Ignore inherited root-only options in nested configs (#20291) (camc314)
- bc20217 oxlint,oxfmt: Omit useless `| null` for `Option<T>` field from schema (#20273) (leaysgur)
- f26e6ab linter: Make `generate-plugin-eslint` script work on windows (#20246) (camc314)

### 📚 Documentation

- e4aa5b5 parser/napi, linter/plugins: Add JSDoc comments to raw transfer constants (#20286) (overlookmotel)
- f339f10 linter/plugins: Promote JS plugins to alpha status (#20281) (overlookmotel)
# Oxfmt
### 🐛 Bug Fixes

- 96f761f oxfmt: Ensure stdin blocking mode is set for non-TTY environments (#20289) (camc314)
- bc20217 oxlint,oxfmt: Omit useless `| null` for `Option<T>` field from schema (#20273) (leaysgur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants