fix(linter): make react/forbid-component-props lists optional#23735
fix(linter): make react/forbid-component-props lists optional#23735camc314 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e5797975d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "properties": { | ||
| "allowedFor": { | ||
| "description": "Component names for which this prop is **allowed** (all others are\nforbidden).", | ||
| "default": [], |
There was a problem hiding this comment.
Preserve the matcher requirement in the schema
With the selector lists now defaulted, ForbidItemObject has no required keys left in the generated schema, so configs like { "forbid": [{}] } or { "forbid": [{ "allowedFor": ["Foo"] }] } validate/type-check even though ForbidItemObject::deserialize still rejects them because exactly one of propName or propNamePattern is required. Please add an explicit schema/type constraint for that discriminator so editor/schema validation matches the runtime behavior.
Useful? React with 👍 / 👎.
Merging this PR will not alter performance
Comparing Footnotes
|
2e57979 to
23a1d57
Compare
|
If you need a Review, you can assign it to me :) Looks complicated 🤞 |
Marks the
react/forbid-component-propsallow/disallow selector lists as defaulted schema fields, so the generated config types treat them as optional and match the rule’s deserialization behavior.Fixes #23732