Skip to content

Commit

Permalink
Change anyOf to oneOf in rule schemas to make intent clearer (#2663)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann authored Jan 5, 2025
1 parent 9607d8e commit 9d8f2de
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/rules/attributes-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ module.exports = {
order: {
type: 'array',
items: {
anyOf: [
oneOf: [
{ enum: Object.values(ATTRS) },
{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/block-lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = {
type: 'object',
properties: {
lang: {
anyOf: [
oneOf: [
{ type: 'string' },
{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/block-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
order: {
type: 'array',
items: {
anyOf: [
oneOf: [
{ type: 'string' },
{ type: 'array', items: { type: 'string' }, uniqueItems: true }
]
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/html-comment-content-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
fixable: 'whitespace',
schema: [
{
anyOf: [
oneOf: [
{
enum: ['always', 'never']
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/html-comment-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
fixable: 'whitespace',
schema: [
{
anyOf: [{ type: 'integer', minimum: 0 }, { enum: ['tab'] }]
oneOf: [{ type: 'integer', minimum: 0 }, { enum: ['tab'] }]
}
],
messages: {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/html-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ module.exports = {
fixable: 'whitespace',
schema: [
{
anyOf: [{ type: 'integer', minimum: 1 }, { enum: ['tab'] }]
oneOf: [{ type: 'integer', minimum: 1 }, { enum: ['tab'] }]
},
{
type: 'object',
properties: {
attribute: { type: 'integer', minimum: 0 },
baseIndent: { type: 'integer', minimum: 0 },
closeBracket: {
anyOf: [
oneOf: [
{ type: 'integer', minimum: 0 },
{
type: 'object',
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/max-attributes-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = {
type: 'object',
properties: {
singleline: {
anyOf: [
oneOf: [
{
type: 'number',
minimum: 1
Expand All @@ -92,7 +92,7 @@ module.exports = {
]
},
multiline: {
anyOf: [
oneOf: [
{
type: 'number',
minimum: 1
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/max-len.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const OPTIONS_SCHEMA = {
}

const OPTIONS_OR_INTEGER_SCHEMA = {
anyOf: [
oneOf: [
OPTIONS_SCHEMA,
{
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-restricted-call-after-await.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
properties: {
module: { type: 'string' },
path: {
anyOf: [
oneOf: [
{ type: 'string' },
{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-restricted-component-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = {
type: 'object',
properties: {
name: {
anyOf: [
oneOf: [
{ type: 'string' },
{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-restricted-static-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = {
type: 'object',
properties: {
key: { type: 'string' },
value: { anyOf: [{ type: 'string' }, { enum: [true] }] },
value: { oneOf: [{ type: 'string' }, { enum: [true] }] },
element: { type: 'string' },
message: { type: 'string', minLength: 1 }
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/script-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
fixable: 'whitespace',
schema: [
{
anyOf: [{ type: 'integer', minimum: 1 }, { enum: ['tab'] }]
oneOf: [{ type: 'integer', minimum: 1 }, { enum: ['tab'] }]
},
{
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/v-slot-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = {
fixable: 'code',
schema: [
{
anyOf: [
oneOf: [
{ enum: ['shorthand', 'longform'] },
{
type: 'object',
Expand Down

0 comments on commit 9d8f2de

Please sign in to comment.