Skip to content

Commit e3e4e10

Browse files
baevmSysix
andauthored
feat(linter): add schema for react_perf/jsx-no-new-object-as-prop (#23368)
issue #22955 --------- Signed-off-by: Alexander S. <[email protected]> Co-authored-by: Alexander S. <[email protected]>
1 parent 9366d44 commit e3e4e10

4 files changed

Lines changed: 38 additions & 5 deletions

File tree

apps/oxlint/src-js/package/config.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ export interface DummyRuleMap {
12011201
"react-perf/jsx-no-jsx-as-prop"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, ReactPerfConfig];
12021202
"react-perf/jsx-no-new-array-as-prop"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, ReactPerfConfig];
12031203
"react-perf/jsx-no-new-function-as-prop"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, ReactPerfConfig];
1204-
"react-perf/jsx-no-new-object-as-prop"?: DummyRule;
1204+
"react-perf/jsx-no-new-object-as-prop"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, ReactPerfConfig];
12051205
"react/button-has-type"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, ButtonHasType];
12061206
"react/checked-requires-onchange-or-readonly"?:
12071207
| AllowWarnDeny

crates/oxc_linter/src/utils/schemars.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::rules::RuleEnum;
1313
/// These should return the DummyRule struct/schema instead of the actual rule struct/schema,
1414
/// until we verify that the rule's schema is valid and can be generated by schemars.
1515
#[cfg(feature = "ruledocs")]
16-
const NO_VERIFIED_VALID_SCHEMA: [&str; 30] = [
16+
const NO_VERIFIED_VALID_SCHEMA: [&str; 29] = [
1717
"eslint/func-name-matching", // second config can be on first position like [AllowWarnDeny, Config1, Config2] | [AllowWarnDeny, Config1] | [AllowWarnDeny, Config2]
1818
"eslint/no-restricted-globals", // uses spread syntax like [AllowWarnDeny, ...Config]
1919
"eslint/no-restricted-imports", // uses spread syntax like [AllowWarnDeny, ...Config]
@@ -39,7 +39,6 @@ const NO_VERIFIED_VALID_SCHEMA: [&str; 30] = [
3939
"react/jsx-curly-brace-presence",
4040
"react/jsx-handler-names",
4141
"react/jsx-no-script-url",
42-
"react_perf/jsx-no-new-object-as-prop",
4342
"typescript/no-restricted-types",
4443
"unicorn/filename-case",
4544
"unicorn/import-style",

npm/oxlint/configuration_schema.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5664,7 +5664,24 @@
56645664
]
56655665
},
56665666
"react-perf/jsx-no-new-object-as-prop": {
5667-
"$ref": "#/definitions/DummyRule"
5667+
"anyOf": [
5668+
{
5669+
"$ref": "#/definitions/AllowWarnDeny"
5670+
},
5671+
{
5672+
"type": "array",
5673+
"items": [
5674+
{
5675+
"$ref": "#/definitions/AllowWarnDeny"
5676+
},
5677+
{
5678+
"$ref": "#/definitions/ReactPerfConfig"
5679+
}
5680+
],
5681+
"maxItems": 2,
5682+
"minItems": 1
5683+
}
5684+
]
56685685
},
56695686
"react/button-has-type": {
56705687
"anyOf": [

tasks/website_linter/src/snapshots/schema_json.snap

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5668,7 +5668,24 @@ expression: json
56685668
]
56695669
},
56705670
"react-perf/jsx-no-new-object-as-prop": {
5671-
"$ref": "#/definitions/DummyRule"
5671+
"anyOf": [
5672+
{
5673+
"$ref": "#/definitions/AllowWarnDeny"
5674+
},
5675+
{
5676+
"type": "array",
5677+
"items": [
5678+
{
5679+
"$ref": "#/definitions/AllowWarnDeny"
5680+
},
5681+
{
5682+
"$ref": "#/definitions/ReactPerfConfig"
5683+
}
5684+
],
5685+
"maxItems": 2,
5686+
"minItems": 1
5687+
}
5688+
]
56725689
},
56735690
"react/button-has-type": {
56745691
"anyOf": [

0 commit comments

Comments
 (0)