@@ -13,7 +13,6 @@ import { matchRule } from '../utils/rule.js';
13
13
import {
14
14
validateNamingPatternObject ,
15
15
globPatternValidator ,
16
- stringResponseValidator ,
17
16
} from '../utils/validation.js' ;
18
17
19
18
/**
@@ -36,8 +35,9 @@ export default {
36
35
} ,
37
36
} ,
38
37
{
39
- stringResponse : {
40
- type : 'boolean' ,
38
+ type : 'object' ,
39
+ properties : {
40
+ nonGlobSuggestion : { type : 'boolean' } ,
41
41
} ,
42
42
} ,
43
43
] ,
@@ -47,11 +47,13 @@ export default {
47
47
return {
48
48
Program : ( node ) => {
49
49
const rules = context . options [ 0 ] ;
50
- const stringResponse = context . options [ 1 ] ;
50
+ const { nonGlobSuggestion } = context . options [ 1 ] || {
51
+ nonGlobSuggestion : false ,
52
+ } ;
51
53
const message = validateNamingPatternObject (
52
54
rules ,
53
55
globPatternValidator ,
54
- stringResponse ? stringResponseValidator : globPatternValidator
56
+ nonGlobSuggestion ? ( ) => true : globPatternValidator
55
57
) ;
56
58
57
59
if ( message ) {
@@ -77,7 +79,7 @@ export default {
77
79
// it's a legacy feature, will be removed in the future
78
80
matchRule ( filename , blockListPattern ) ;
79
81
80
- const messageFN = stringResponse
82
+ const messageFN = nonGlobSuggestion
81
83
? FILENAME_BLOCKLIST_NONPATTERN_ERROR_MESSAGE
82
84
: FILENAME_BLOCKLIST_ERROR_MESSAGE ;
83
85
0 commit comments