Skip to content

Commit 85ae820

Browse files
committed
[Perf] use anyOf instead of oneOf
See eslint/eslint#16691
1 parent 415635f commit 85ae820

11 files changed

+14
-13
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
2626
* [meta] add issue template ([#3483][] @ROSSROSALES)
2727
* [Docs] Use emoji for jsx-runtime config and config file for eslint-doc-generator ([#3504][] @bmish)[
2828
* [Docs] [`prefer-exact-props`]: fix example flow syntax ([#3510][] @smackfu)
29+
* [Perf] use `anyOf` instead of `oneOf` (@ljharb @remcohaszing)
2930

3031
[#3510]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3510
3132
[#3504]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3504

lib/rules/forbid-component-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
forbid: {
4040
type: 'array',
4141
items: {
42-
oneOf: [{
42+
anyOf: [{
4343
type: 'string',
4444
}, {
4545
type: 'object',

lib/rules/forbid-dom-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = {
5454
forbid: {
5555
type: 'array',
5656
items: {
57-
oneOf: [{
57+
anyOf: [{
5858
type: 'string',
5959
}, {
6060
type: 'object',

lib/rules/function-component-definition.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = {
132132
type: 'object',
133133
properties: {
134134
namedComponents: {
135-
oneOf: [
135+
anyOf: [
136136
{
137137
enum: [
138138
'function-declaration',
@@ -154,7 +154,7 @@ module.exports = {
154154
],
155155
},
156156
unnamedComponents: {
157-
oneOf: [
157+
anyOf: [
158158
{ enum: ['arrow-function', 'function-expression'] },
159159
{
160160
type: 'array',

lib/rules/jsx-closing-bracket-location.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
messages,
3131

3232
schema: [{
33-
oneOf: [
33+
anyOf: [
3434
{
3535
enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'],
3636
},

lib/rules/jsx-curly-brace-presence.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050

5151
schema: [
5252
{
53-
oneOf: [
53+
anyOf: [
5454
{
5555
type: 'object',
5656
properties: {

lib/rules/jsx-curly-newline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656

5757
schema: [
5858
{
59-
oneOf: [
59+
anyOf: [
6060
{
6161
enum: ['consistent', 'never'],
6262
},

lib/rules/jsx-curly-spacing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
},
6969
},
7070
basicConfigOrBoolean: {
71-
oneOf: [{
71+
anyOf: [{
7272
$ref: '#/definitions/basicConfig',
7373
}, {
7474
type: 'boolean',
@@ -77,7 +77,7 @@ module.exports = {
7777
},
7878
type: 'array',
7979
items: [{
80-
oneOf: [{
80+
anyOf: [{
8181
allOf: [{
8282
$ref: '#/definitions/basicConfig',
8383
}, {

lib/rules/jsx-indent-props.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ module.exports = {
5555
messages,
5656

5757
schema: [{
58-
oneOf: [{
58+
anyOf: [{
5959
enum: ['tab', 'first'],
6060
}, {
6161
type: 'integer',
6262
}, {
6363
type: 'object',
6464
properties: {
6565
indentMode: {
66-
oneOf: [{
66+
anyOf: [{
6767
enum: ['tab', 'first'],
6868
}, {
6969
type: 'integer',

lib/rules/jsx-indent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
messages,
5959

6060
schema: [{
61-
oneOf: [{
61+
anyOf: [{
6262
enum: ['tab'],
6363
}, {
6464
type: 'integer',

lib/rules/no-unescaped-entities.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
forbid: {
5353
type: 'array',
5454
items: {
55-
oneOf: [{
55+
anyOf: [{
5656
type: 'string',
5757
}, {
5858
type: 'object',

0 commit comments

Comments
 (0)