File tree Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,48 @@ ruleTester.run(
95
95
}
96
96
) ;
97
97
98
- // custom rule
98
+ ruleTester . run (
99
+ "folder-naming-convention with option: [{ 'components/*/': '__+([a-z])' }]" ,
100
+ rule ,
101
+ {
102
+ valid : [
103
+ {
104
+ code : "var foo = 'bar';" ,
105
+ filename : 'src/components/__displaylabel/index.js' ,
106
+ options : [ { 'components/*/' : '__+([a-z])' } ] ,
107
+ } ,
108
+ ] ,
109
+
110
+ invalid : [
111
+ {
112
+ code : "var foo = 'bar';" ,
113
+ filename : 'src/components/_displayLabel/index.js' ,
114
+ options : [ { 'components/*/' : '__+([a-z])' } ] ,
115
+ errors : [
116
+ {
117
+ message :
118
+ 'The folder "_displayLabel" does not match the "__+([a-z])" style' ,
119
+ column : 1 ,
120
+ line : 1 ,
121
+ } ,
122
+ ] ,
123
+ } ,
124
+ {
125
+ code : "var foo = 'bar';" ,
126
+ filename : 'src/components/__displayLabel/index.js' ,
127
+ options : [ { 'components/*/' : '__+([a-z])' } ] ,
128
+ errors : [
129
+ {
130
+ message :
131
+ 'The folder "__displayLabel" does not match the "__+([a-z])" style' ,
132
+ column : 1 ,
133
+ line : 1 ,
134
+ } ,
135
+ ] ,
136
+ } ,
137
+ ] ,
138
+ }
139
+ ) ;
99
140
100
141
ruleTester . run (
101
142
'folder-naming-convention with folder that has not been set' ,
You can’t perform that action at this time.
0 commit comments