fix(oxlint,oxfmt): Omit useless | null for Option<T> field from schema#20273
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. |
| null for Option<T> field from schema
There was a problem hiding this comment.
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
schemarsgenerator withoption_add_null_type = false. - Regenerate website snapshot schemas and published npm
configuration_schema.jsonfiles to removenullfrom many option types. - Regenerate
config.generated.tstypings to drop| nullfrom 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.
camc314
left a comment
There was a problem hiding this comment.
aren't all these files generated? How come the generated code no longer incudes | null
camc314
left a comment
There was a problem hiding this comment.
ah I missed the rust change
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.
a509714 to
bc20217
Compare
# 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)

Currently, fields defined as
key: Option<T>are represented in TS askey?: T | null.However, passing
nullactually just treats it asNone, which only creates noise.