@@ -129,6 +129,41 @@ tester.run('key-format-style', rule as never, {
129
129
...options . json . file ,
130
130
options : [ 'kebab-case' ]
131
131
} ,
132
+ {
133
+ code : `
134
+ lowercase:
135
+ foobar: kebab-value
136
+ ` ,
137
+ ...options . yaml . file
138
+ } ,
139
+ {
140
+ code : `{
141
+ "lowercase": {
142
+ "foobar": "kebab-value"
143
+ }
144
+ }
145
+ ` ,
146
+ ...options . json . file
147
+ } ,
148
+ {
149
+ code : `
150
+ en-US:
151
+ lowercase:
152
+ foobar: kebab-value
153
+ ` ,
154
+ ...options . yaml . key
155
+ } ,
156
+ {
157
+ code : `{
158
+ "en-US": {
159
+ "lowercase": {
160
+ "foobar": "kebab-value"
161
+ }
162
+ }
163
+ }
164
+ ` ,
165
+ ...options . json . key
166
+ } ,
132
167
{
133
168
code : `
134
169
snake_case:
@@ -379,6 +414,136 @@ tester.run('key-format-style', rule as never, {
379
414
}
380
415
]
381
416
} ,
417
+ {
418
+ code : `
419
+ foo-bar: baz
420
+ ` ,
421
+ ...options . yaml . file ,
422
+ options : [ 'lowercase' ] ,
423
+ errors : [
424
+ {
425
+ message : '"foo-bar" is not lowercase' ,
426
+ line : 2
427
+ }
428
+ ]
429
+ } ,
430
+ {
431
+ code : `
432
+ en-US:
433
+ foo-bar: baz
434
+ ` ,
435
+ ...options . yaml . key ,
436
+ options : [ 'lowercase' ] ,
437
+ errors : [
438
+ {
439
+ message : '"foo-bar" is not lowercase' ,
440
+ line : 3
441
+ }
442
+ ]
443
+ } ,
444
+ {
445
+ code : `
446
+ {"foo-bar": "baz"}
447
+ ` ,
448
+ ...options . json . file ,
449
+ options : [ 'lowercase' ] ,
450
+ errors : [
451
+ {
452
+ message : '"foo-bar" is not lowercase' ,
453
+ line : 2
454
+ }
455
+ ]
456
+ } ,
457
+ {
458
+ code : `
459
+ {"en-US": {
460
+ "foo-bar": "baz"
461
+ }}` ,
462
+ ...options . json . key ,
463
+ options : [ 'lowercase' ] ,
464
+ errors : [
465
+ {
466
+ message : '"foo-bar" is not lowercase' ,
467
+ line : 3
468
+ }
469
+ ]
470
+ } ,
471
+ {
472
+ code : `
473
+ kebab-case:
474
+ snake_case: camelCase
475
+ ` ,
476
+ ...options . yaml . file ,
477
+ options : [ 'lowercase' ] ,
478
+ errors : [
479
+ {
480
+ message : '"kebab-case" is not lowercase' ,
481
+ line : 2
482
+ } ,
483
+ {
484
+ message : '"snake_case" is not lowercase' ,
485
+ line : 3
486
+ }
487
+ ]
488
+ } ,
489
+ {
490
+ code : `{
491
+ "kebab-case": {
492
+ "snake_case": "camelCase"
493
+ }
494
+ }
495
+ ` ,
496
+ ...options . json . file ,
497
+ options : [ 'lowercase' ] ,
498
+ errors : [
499
+ {
500
+ message : '"kebab-case" is not lowercase' ,
501
+ line : 2
502
+ } ,
503
+ {
504
+ message : '"snake_case" is not lowercase' ,
505
+ line : 3
506
+ }
507
+ ]
508
+ } ,
509
+ {
510
+ code : `
511
+ SCREAMING_SNAKE_CASE:
512
+ PascalCase: camelCase
513
+ ` ,
514
+ ...options . yaml . file ,
515
+ options : [ 'lowercase' ] ,
516
+ errors : [
517
+ {
518
+ message : '"SCREAMING_SNAKE_CASE" is not lowercase' ,
519
+ line : 2
520
+ } ,
521
+ {
522
+ message : '"PascalCase" is not lowercase' ,
523
+ line : 3
524
+ }
525
+ ]
526
+ } ,
527
+ {
528
+ code : `{
529
+ "SCREAMING_SNAKE_CASE": {
530
+ "PascalCase": "camelCase"
531
+ }
532
+ }
533
+ ` ,
534
+ ...options . json . file ,
535
+ options : [ 'lowercase' ] ,
536
+ errors : [
537
+ {
538
+ message : '"SCREAMING_SNAKE_CASE" is not lowercase' ,
539
+ line : 2
540
+ } ,
541
+ {
542
+ message : '"PascalCase" is not lowercase' ,
543
+ line : 3
544
+ }
545
+ ]
546
+ } ,
382
547
{
383
548
code : `
384
549
- foo
0 commit comments