Skip to content

Commit

Permalink
[Perf] use anyOf instead of oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 22, 2022
1 parent 415635f commit 85ae820
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [meta] add issue template ([#3483][] @ROSSROSALES)
* [Docs] Use emoji for jsx-runtime config and config file for eslint-doc-generator ([#3504][] @bmish)[
* [Docs] [`prefer-exact-props`]: fix example flow syntax ([#3510][] @smackfu)
* [Perf] use `anyOf` instead of `oneOf` (@ljharb @remcohaszing)

[#3510]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3510
[#3504]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3504
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/forbid-component-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
forbid: {
type: 'array',
items: {
oneOf: [{
anyOf: [{
type: 'string',
}, {
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
forbid: {
type: 'array',
items: {
oneOf: [{
anyOf: [{
type: 'string',
}, {
type: 'object',
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/function-component-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = {
type: 'object',
properties: {
namedComponents: {
oneOf: [
anyOf: [
{
enum: [
'function-declaration',
Expand All @@ -154,7 +154,7 @@ module.exports = {
],
},
unnamedComponents: {
oneOf: [
anyOf: [
{ enum: ['arrow-function', 'function-expression'] },
{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-closing-bracket-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
messages,

schema: [{
oneOf: [
anyOf: [
{
enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-curly-brace-presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {

schema: [
{
oneOf: [
anyOf: [
{
type: 'object',
properties: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-curly-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = {

schema: [
{
oneOf: [
anyOf: [
{
enum: ['consistent', 'never'],
},
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
},
},
basicConfigOrBoolean: {
oneOf: [{
anyOf: [{
$ref: '#/definitions/basicConfig',
}, {
type: 'boolean',
Expand All @@ -77,7 +77,7 @@ module.exports = {
},
type: 'array',
items: [{
oneOf: [{
anyOf: [{
allOf: [{
$ref: '#/definitions/basicConfig',
}, {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/jsx-indent-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ module.exports = {
messages,

schema: [{
oneOf: [{
anyOf: [{
enum: ['tab', 'first'],
}, {
type: 'integer',
}, {
type: 'object',
properties: {
indentMode: {
oneOf: [{
anyOf: [{
enum: ['tab', 'first'],
}, {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
messages,

schema: [{
oneOf: [{
anyOf: [{
enum: ['tab'],
}, {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unescaped-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = {
forbid: {
type: 'array',
items: {
oneOf: [{
anyOf: [{
type: 'string',
}, {
type: 'object',
Expand Down

0 comments on commit 85ae820

Please sign in to comment.