@@ -54,18 +54,6 @@ function getCalleeMemberNode(node) {
54
54
return null
55
55
}
56
56
57
- const OBJECT_OPTION_SCHEMA = {
58
- type : 'object' ,
59
- properties : {
60
- ignores : {
61
- type : 'array' ,
62
- items : { type : 'string' } ,
63
- uniqueItems : true ,
64
- additionalItems : false
65
- }
66
- } ,
67
- additionalProperties : false
68
- }
69
57
module . exports = {
70
58
meta : {
71
59
type : 'suggestion' ,
@@ -75,24 +63,23 @@ module.exports = {
75
63
url : 'https://eslint.vuejs.org/rules/custom-event-name-casing.html'
76
64
} ,
77
65
fixable : null ,
78
- schema : {
79
- anyOf : [
80
- {
81
- type : 'array' ,
82
- items : [
83
- {
84
- enum : ALLOWED_CASE_OPTIONS
85
- } ,
86
- OBJECT_OPTION_SCHEMA
87
- ]
66
+ schema : [
67
+ {
68
+ enum : ALLOWED_CASE_OPTIONS
69
+ } ,
70
+ {
71
+ type : 'object' ,
72
+ properties : {
73
+ ignores : {
74
+ type : 'array' ,
75
+ items : { type : 'string' } ,
76
+ uniqueItems : true ,
77
+ additionalItems : false
78
+ }
88
79
} ,
89
- // For backward compatibility
90
- {
91
- type : 'array' ,
92
- items : [ OBJECT_OPTION_SCHEMA ]
93
- }
94
- ]
95
- } ,
80
+ additionalProperties : false
81
+ }
82
+ ] ,
96
83
messages : {
97
84
unexpected : "Custom event name '{{name}}' must be {{caseType}}."
98
85
}
@@ -102,13 +89,8 @@ module.exports = {
102
89
/** @type {Map<ObjectExpression|Program, {contextReferenceIds:Set<Identifier>,emitReferenceIds:Set<Identifier>}> } */
103
90
const setupContexts = new Map ( )
104
91
let emitParamName = ''
105
- const options =
106
- context . options . length === 1 && typeof context . options [ 0 ] !== 'string'
107
- ? // For backward compatibility
108
- [ undefined , context . options [ 0 ] ]
109
- : context . options
110
- const caseType = options [ 0 ] || DEFAULT_CASE
111
- const objectOption = options [ 1 ] || { }
92
+ const caseType = context . options [ 0 ] || DEFAULT_CASE
93
+ const objectOption = context . options [ 1 ] || { }
112
94
const caseChecker = casing . getChecker ( caseType )
113
95
/** @type {RegExp[] } */
114
96
const ignores = ( objectOption . ignores || [ ] ) . map ( toRegExp )
0 commit comments