Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 24e4d6b

Browse files
committedFeb 2, 2021
Change options schema to strictly.
1 parent cc9c140 commit 24e4d6b

13 files changed

+52
-26
lines changed
 

‎lib/rules/attributes-order.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,33 @@ module.exports = {
346346
url: 'https://eslint.vuejs.org/rules/attributes-order.html'
347347
},
348348
fixable: 'code',
349-
schema: {
350-
type: 'array',
351-
properties: {
352-
order: {
353-
items: {
354-
type: 'string'
349+
schema: [
350+
{
351+
type: 'object',
352+
properties: {
353+
order: {
354+
type: 'array',
355+
items: {
356+
anyOf: [
357+
{ enum: Object.values(ATTRS) },
358+
{
359+
type: 'array',
360+
items: {
361+
enum: Object.values(ATTRS),
362+
uniqueItems: true,
363+
additionalItems: false
364+
}
365+
}
366+
]
367+
},
368+
uniqueItems: true,
369+
additionalItems: false
355370
},
356-
maxItems: 10,
357-
minItems: 10
358-
}
371+
alphabetical: { type: 'boolean' }
372+
},
373+
additionalProperties: false
359374
}
360-
}
375+
]
361376
},
362377
create
363378
}

‎lib/rules/component-tags-order.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ module.exports = {
4040
uniqueItems: true,
4141
additionalItems: false
4242
}
43-
}
43+
},
44+
additionalProperties: false
4445
}
4546
],
4647
messages: {

‎lib/rules/max-attributes-per-line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ module.exports = {
6161
}
6262
]
6363
}
64-
}
64+
},
65+
additionalProperties: false
6566
}
6667
]
6768
},

‎lib/rules/new-line-between-multi-line-property.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ module.exports = {
6868
type: 'number',
6969
minimum: 2
7070
}
71-
}
71+
},
72+
additionalProperties: false
7273
}
7374
]
7475
},

‎lib/rules/no-bare-strings-in-template.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ module.exports = {
149149
items: { type: 'string', pattern: '^v-' },
150150
uniqueItems: true
151151
}
152-
}
152+
},
153+
additionalProperties: false
153154
}
154155
],
155156
messages: {

‎lib/rules/no-duplicate-attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ module.exports = {
5959
allowCoexistStyle: {
6060
type: 'boolean'
6161
}
62-
}
62+
},
63+
additionalProperties: false
6364
}
6465
]
6566
},

‎lib/rules/no-potential-component-option-typo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ module.exports = {
4444
type: 'number',
4545
minimum: 1
4646
}
47-
}
47+
},
48+
additionalProperties: false
4849
}
4950
]
5051
},

‎lib/rules/no-reserved-component-names.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ module.exports = {
8484
disallowVue3BuiltInComponents: {
8585
type: 'boolean'
8686
}
87-
}
87+
},
88+
additionalProperties: false
8889
}
8990
],
9091
messages: {

‎lib/rules/no-use-v-if-with-v-for.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ module.exports = {
6262
allowUsingIterationVar: {
6363
type: 'boolean'
6464
}
65-
}
65+
},
66+
additionalProperties: false
6667
}
6768
]
6869
},

‎lib/rules/no-useless-mustaches.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ module.exports = {
5050
ignoreStringEscape: {
5151
type: 'boolean'
5252
}
53-
}
53+
},
54+
additionalProperties: false
5455
}
5556
],
5657
type: 'suggestion'

‎lib/rules/no-useless-v-bind.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = {
3030
ignoreStringEscape: {
3131
type: 'boolean'
3232
}
33-
}
33+
},
34+
additionalProperties: false
3435
}
3536
],
3637
type: 'suggestion'

‎lib/rules/valid-v-slot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ module.exports = {
287287
allowModifiers: {
288288
type: 'boolean'
289289
}
290-
}
290+
},
291+
additionalProperties: false
291292
}
292293
],
293294
messages: {

‎tests/lib/rules/attributes-order.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ tester.run('attributes-order', rule, {
259259
<div
260260
v-if="!visible"
261261
class="content"
262-
:class="className"
262+
v-model="foo"
263263
v-text="textContent"
264264
>
265265
</div>
@@ -273,7 +273,7 @@ tester.run('attributes-order', rule, {
273273
'DEFINITION',
274274
'EVENTS',
275275
'UNIQUE',
276-
['BINDING', 'OTHER_ATTR'],
276+
['TWO_WAY_BINDING', 'OTHER_ATTR'],
277277
'CONTENT',
278278
'GLOBAL'
279279
]
@@ -705,7 +705,7 @@ tester.run('attributes-order', rule, {
705705
<div
706706
class="content"
707707
v-if="!visible"
708-
:class="className"
708+
v-model="foo"
709709
v-text="textContent"
710710
>
711711
</div>
@@ -719,7 +719,7 @@ tester.run('attributes-order', rule, {
719719
'DEFINITION',
720720
'EVENTS',
721721
'UNIQUE',
722-
['BINDING', 'OTHER_ATTR'],
722+
['TWO_WAY_BINDING', 'OTHER_ATTR'],
723723
'CONTENT',
724724
'GLOBAL'
725725
]
@@ -729,7 +729,7 @@ tester.run('attributes-order', rule, {
729729
<div
730730
v-if="!visible"
731731
class="content"
732-
:class="className"
732+
v-model="foo"
733733
v-text="textContent"
734734
>
735735
</div>

0 commit comments

Comments
 (0)
Please sign in to comment.