@@ -104,6 +104,38 @@ describe("convertVariableName", () => {
104
104
} ) ;
105
105
} ) ;
106
106
107
+ test ( "conversion with allow-pascal-case argument with check-format" , ( ) => {
108
+ const result = convertVariableName ( {
109
+ ruleArguments : [ "allow-pascal-case" , "check-format" ] ,
110
+ } ) ;
111
+
112
+ expect ( result ) . toEqual ( {
113
+ rules : [
114
+ {
115
+ ruleName : "@typescript-eslint/naming-convention" ,
116
+ rules : [
117
+ {
118
+ selector : "variable" ,
119
+ format : [ "camelCase" , "UPPER_CASE" , "PascalCase" ] ,
120
+ leadingUnderscore : "forbid" ,
121
+ trailingUnderscore : "forbid" ,
122
+ } ,
123
+ ] ,
124
+ } ,
125
+ {
126
+ notices : [ ForbiddenLeadingTrailingIdentifierMsg ] ,
127
+ ruleName : "no-underscore-dangle" ,
128
+ } ,
129
+ {
130
+ ruleName : "id-denylist" ,
131
+ } ,
132
+ {
133
+ ruleName : "id-match" ,
134
+ } ,
135
+ ] ,
136
+ } ) ;
137
+ } ) ;
138
+
107
139
test ( "conversion with allow-snake-case argument without check-format argument" , ( ) => {
108
140
const result = convertVariableName ( {
109
141
ruleArguments : [ "allow-snake-case" ] ,
@@ -136,6 +168,38 @@ describe("convertVariableName", () => {
136
168
} ) ;
137
169
} ) ;
138
170
171
+ test ( "conversion with allow-snake-case argument with check-format" , ( ) => {
172
+ const result = convertVariableName ( {
173
+ ruleArguments : [ "allow-snake-case" , "check-format" ] ,
174
+ } ) ;
175
+
176
+ expect ( result ) . toEqual ( {
177
+ rules : [
178
+ {
179
+ ruleName : "@typescript-eslint/naming-convention" ,
180
+ rules : [
181
+ {
182
+ selector : "variable" ,
183
+ format : [ "camelCase" , "UPPER_CASE" , "snake_case" ] ,
184
+ leadingUnderscore : "forbid" ,
185
+ trailingUnderscore : "forbid" ,
186
+ } ,
187
+ ] ,
188
+ } ,
189
+ {
190
+ notices : [ ForbiddenLeadingTrailingIdentifierMsg ] ,
191
+ ruleName : "no-underscore-dangle" ,
192
+ } ,
193
+ {
194
+ ruleName : "id-denylist" ,
195
+ } ,
196
+ {
197
+ ruleName : "id-match" ,
198
+ } ,
199
+ ] ,
200
+ } ) ;
201
+ } ) ;
202
+
139
203
test ( "conversion with allow-leading-underscore without check-format argument" , ( ) => {
140
204
const result = convertVariableName ( {
141
205
ruleArguments : [ "allow-leading-underscore" ] ,
@@ -388,7 +452,7 @@ describe("convertVariableName", () => {
388
452
rules : [
389
453
{
390
454
selector : "variable" ,
391
- format : [ "camelCase" , "UPPER_CASE" ] ,
455
+ format : [ "camelCase" , "UPPER_CASE" , "PascalCase" , "snake_case" ] ,
392
456
leadingUnderscore : "allow" ,
393
457
trailingUnderscore : "allow" ,
394
458
} ,
0 commit comments