Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change options schema to strictly. #1430

Merged
merged 1 commit into from Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 25 additions & 10 deletions lib/rules/attributes-order.js
Expand Up @@ -346,18 +346,33 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/attributes-order.html'
},
fixable: 'code',
schema: {
type: 'array',
properties: {
order: {
items: {
type: 'string'
schema: [
{
type: 'object',
properties: {
order: {
type: 'array',
items: {
anyOf: [
{ enum: Object.values(ATTRS) },
{
type: 'array',
items: {
enum: Object.values(ATTRS),
uniqueItems: true,
additionalItems: false
}
}
]
},
uniqueItems: true,
additionalItems: false
},
maxItems: 10,
minItems: 10
}
alphabetical: { type: 'boolean' }
},
additionalProperties: false
}
}
]
},
create
}
3 changes: 2 additions & 1 deletion lib/rules/component-tags-order.js
Expand Up @@ -40,7 +40,8 @@ module.exports = {
uniqueItems: true,
additionalItems: false
}
}
},
additionalProperties: false
}
],
messages: {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/max-attributes-per-line.js
Expand Up @@ -61,7 +61,8 @@ module.exports = {
}
]
}
}
},
additionalProperties: false
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/new-line-between-multi-line-property.js
Expand Up @@ -68,7 +68,8 @@ module.exports = {
type: 'number',
minimum: 2
}
}
},
additionalProperties: false
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-bare-strings-in-template.js
Expand Up @@ -149,7 +149,8 @@ module.exports = {
items: { type: 'string', pattern: '^v-' },
uniqueItems: true
}
}
},
additionalProperties: false
}
],
messages: {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-duplicate-attributes.js
Expand Up @@ -59,7 +59,8 @@ module.exports = {
allowCoexistStyle: {
type: 'boolean'
}
}
},
additionalProperties: false
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-potential-component-option-typo.js
Expand Up @@ -44,7 +44,8 @@ module.exports = {
type: 'number',
minimum: 1
}
}
},
additionalProperties: false
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-reserved-component-names.js
Expand Up @@ -84,7 +84,8 @@ module.exports = {
disallowVue3BuiltInComponents: {
type: 'boolean'
}
}
},
additionalProperties: false
}
],
messages: {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-use-v-if-with-v-for.js
Expand Up @@ -62,7 +62,8 @@ module.exports = {
allowUsingIterationVar: {
type: 'boolean'
}
}
},
additionalProperties: false
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-useless-mustaches.js
Expand Up @@ -50,7 +50,8 @@ module.exports = {
ignoreStringEscape: {
type: 'boolean'
}
}
},
additionalProperties: false
}
],
type: 'suggestion'
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-useless-v-bind.js
Expand Up @@ -30,7 +30,8 @@ module.exports = {
ignoreStringEscape: {
type: 'boolean'
}
}
},
additionalProperties: false
}
],
type: 'suggestion'
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/valid-v-slot.js
Expand Up @@ -287,7 +287,8 @@ module.exports = {
allowModifiers: {
type: 'boolean'
}
}
},
additionalProperties: false
}
],
messages: {
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/rules/attributes-order.js
Expand Up @@ -259,7 +259,7 @@ tester.run('attributes-order', rule, {
<div
v-if="!visible"
class="content"
:class="className"
v-model="foo"
v-text="textContent"
>
</div>
Expand All @@ -273,7 +273,7 @@ tester.run('attributes-order', rule, {
'DEFINITION',
'EVENTS',
'UNIQUE',
['BINDING', 'OTHER_ATTR'],
['TWO_WAY_BINDING', 'OTHER_ATTR'],
'CONTENT',
'GLOBAL'
]
Expand Down Expand Up @@ -705,7 +705,7 @@ tester.run('attributes-order', rule, {
<div
class="content"
v-if="!visible"
:class="className"
v-model="foo"
v-text="textContent"
>
</div>
Expand All @@ -719,7 +719,7 @@ tester.run('attributes-order', rule, {
'DEFINITION',
'EVENTS',
'UNIQUE',
['BINDING', 'OTHER_ATTR'],
['TWO_WAY_BINDING', 'OTHER_ATTR'],
'CONTENT',
'GLOBAL'
]
Expand All @@ -729,7 +729,7 @@ tester.run('attributes-order', rule, {
<div
v-if="!visible"
class="content"
:class="className"
v-model="foo"
v-text="textContent"
>
</div>
Expand Down