@@ -420,6 +420,104 @@ format(
420420}
421421` ;
422422
423+ exports [` should load .oxfmtrc.jsonc with trailing comma 1` ] = `
424+ {
425+ " fixture" : " jsonc-trailing-comma" ,
426+ " summary" : [
427+ {
428+ " file" : " src/example.js" ,
429+ " messages" : [
430+ {
431+ " column" : 3 ,
432+ " endColumn" : 32 ,
433+ " endLine" : 2 ,
434+ " fix" : {
435+ " text" : " console.log(
436+ ' hello world' ,
437+ )",
438+ },
439+ " line" : 2 ,
440+ " message" : " Replace \` ··console.log(" hello ·world " );\` with \` console.log(⏎····'hello·world',⏎··)\` " ,
441+ " messageId" : " replace" ,
442+ " ruleId" : " oxfmt/oxfmt" ,
443+ " severity" : 2 ,
444+ },
445+ {
446+ " column" : 8 ,
447+ " endColumn" : 43 ,
448+ " endLine" : 5 ,
449+ " fix" : {
450+ " text" : "
451+ reallyLongArg(),
452+ anotherLongArg (),",
453+ },
454+ " line" : 5 ,
455+ " message" : " Replace \` reallyLongArg(),·anotherLongArg());\` with \` ⏎··reallyLongArg(),⏎··anotherLongArg(),\` " ,
456+ " messageId" : " replace" ,
457+ " ruleId" : " oxfmt/oxfmt" ,
458+ " severity" : 2 ,
459+ },
460+ {
461+ " column" : 1 ,
462+ " endColumn" : 1 ,
463+ " endLine" : 6 ,
464+ " fix" : {
465+ " text" : " )" ,
466+ },
467+ " line" : 6 ,
468+ " message" : " Insert \` )\` " ,
469+ " messageId" : " insert" ,
470+ " ruleId" : " oxfmt/oxfmt" ,
471+ " severity" : 2 ,
472+ },
473+ ],
474+ " output" : " export function greet() {
475+ console .log (
476+ ' hello world' ,
477+ )
478+ }
479+
480+ format (
481+ reallyLongArg (),
482+ anotherLongArg (),
483+ )" ,
484+ },
485+ ],
486+ }
487+ ` ;
488+
489+ exports [` should load empty .oxfmtrc.jsonc 1` ] = `
490+ {
491+ " fixture" : " jsonc-empty" ,
492+ " summary" : [
493+ {
494+ " file" : " src/example.js" ,
495+ " messages" : [
496+ {
497+ " column" : 3 ,
498+ " endColumn" : 5 ,
499+ " endLine" : 2 ,
500+ " fix" : {
501+ " text" : " " ,
502+ },
503+ " line" : 2 ,
504+ " message" : " Delete \` ··\` " ,
505+ " messageId" : " delete" ,
506+ " ruleId" : " oxfmt/oxfmt" ,
507+ " severity" : 2 ,
508+ },
509+ ],
510+ " output" : " export function greet() {
511+ console .log (" hello world" );
512+ }
513+
514+ format (reallyLongArg (), anotherLongArg ());
515+ " ,
516+ },
517+ ],
518+ }
519+ ` ;
520+
423521exports [` should load oxfmt.config.ts 1` ] = `
424522{
425523 " fixture" : " ts-config" ,
0 commit comments