@@ -16,17 +16,11 @@ module.exports = {
16
16
/** @type {{ ignore: string[] } } */
17
17
const options = context . options [ 0 ] || { }
18
18
const { ignore = [ ] } = options
19
- /** @type {Set<string> } */
20
- const ignoreStrings = new Set ( )
21
19
/** @type {RegExp[] } */
22
20
const ignorePatterns = [ ]
23
21
24
22
for ( const str of ignore ) {
25
- if ( regexp . isRegExp ( str ) ) {
26
- ignorePatterns . push ( regexp . toRegExp ( str ) )
27
- } else {
28
- ignoreStrings . add ( str )
29
- }
23
+ ignorePatterns . push ( regexp . toRegExp ( str ) )
30
24
}
31
25
32
26
const sourceCode = context . getSourceCode ( )
@@ -136,15 +130,16 @@ module.exports = {
136
130
function reportSlot ( slotAttr ) {
137
131
const componentName = slotAttr . parent . parent . rawName
138
132
if (
139
- ignoreStrings . has ( componentName ) ||
140
- ignoreStrings . has ( casing . pascalCase ( componentName ) ) ||
141
- ignoreStrings . has ( casing . kebabCase ( componentName ) )
133
+ ignorePatterns . some ( ( pattern ) => pattern . test ( componentName ) ) ||
134
+ ignorePatterns . some ( ( pattern ) =>
135
+ pattern . test ( casing . pascalCase ( componentName ) )
136
+ ) ||
137
+ ignorePatterns . some ( ( pattern ) =>
138
+ pattern . test ( casing . kebabCase ( componentName ) )
139
+ )
142
140
) {
143
141
return
144
142
}
145
- if ( ignorePatterns . some ( ( pattern ) => pattern . test ( componentName ) ) ) {
146
- return
147
- }
148
143
149
144
context . report ( {
150
145
node : slotAttr . key ,
0 commit comments