@@ -640,6 +640,18 @@ Finished in Xms on 1 file using X threads."
640640
641641exports[`oxlint CLI > should support \`createOnce\` 1`] = `
642642"
643+ x create-once-plugin(after-only): after hook: filename: files/1.js
644+ ,-[files/1.js:1:1]
645+ 1 | let x;
646+ : ^
647+ \`----
648+
649+ x create-once-plugin(after-only): after hook: id: create-once-plugin/after-only
650+ ,-[files/1.js:1:1]
651+ 1 | let x;
652+ : ^
653+ \`----
654+
643655 x create-once-plugin(always-run): createOnce: filename: Cannot access \`context.filename\` in \`createOnce\`
644656 ,-[files/1.js:1:1]
645657 1 | let x;
@@ -700,6 +712,18 @@ exports[`oxlint CLI > should support \`createOnce\` 1`] = `
700712 : ^
701713 \`----
702714
715+ x create-once-plugin(before-only): before hook: filename: files/1.js
716+ ,-[files/1.js:1:1]
717+ 1 | let x;
718+ : ^
719+ \`----
720+
721+ x create-once-plugin(before-only): before hook: id: create-once-plugin/before-only
722+ ,-[files/1.js:1:1]
723+ 1 | let x;
724+ : ^
725+ \`----
726+
703727 x create-once-plugin(skip-run): before hook: filename: files/1.js
704728 ,-[files/1.js:1:1]
705729 1 | let x;
@@ -712,12 +736,42 @@ exports[`oxlint CLI > should support \`createOnce\` 1`] = `
712736 : ^
713737 \`----
714738
739+ x create-once-plugin(after-only): ident visit fn "x": filename: files/1.js
740+ ,-[files/1.js:1:5]
741+ 1 | let x;
742+ : ^
743+ \`----
744+
715745 x create-once-plugin(always-run): ident visit fn "x": filename: files/1.js
716746 ,-[files/1.js:1:5]
717747 1 | let x;
718748 : ^
719749 \`----
720750
751+ x create-once-plugin(before-only): ident visit fn "x": filename: files/1.js
752+ ,-[files/1.js:1:5]
753+ 1 | let x;
754+ : ^
755+ \`----
756+
757+ x create-once-plugin(no-hooks): ident visit fn "x": filename: files/1.js
758+ ,-[files/1.js:1:5]
759+ 1 | let x;
760+ : ^
761+ \`----
762+
763+ x create-once-plugin(after-only): after hook: filename: files/2.js
764+ ,-[files/2.js:1:1]
765+ 1 | let y;
766+ : ^
767+ \`----
768+
769+ x create-once-plugin(after-only): after hook: id: create-once-plugin/after-only
770+ ,-[files/2.js:1:1]
771+ 1 | let y;
772+ : ^
773+ \`----
774+
721775 x create-once-plugin(always-run): createOnce: filename: Cannot access \`context.filename\` in \`createOnce\`
722776 ,-[files/2.js:1:1]
723777 1 | let y;
@@ -778,6 +832,18 @@ exports[`oxlint CLI > should support \`createOnce\` 1`] = `
778832 : ^
779833 \`----
780834
835+ x create-once-plugin(before-only): before hook: filename: files/2.js
836+ ,-[files/2.js:1:1]
837+ 1 | let y;
838+ : ^
839+ \`----
840+
841+ x create-once-plugin(before-only): before hook: id: create-once-plugin/before-only
842+ ,-[files/2.js:1:1]
843+ 1 | let y;
844+ : ^
845+ \`----
846+
781847 x create-once-plugin(skip-run): before hook: filename: files/2.js
782848 ,-[files/2.js:1:1]
783849 1 | let y;
@@ -790,13 +856,31 @@ exports[`oxlint CLI > should support \`createOnce\` 1`] = `
790856 : ^
791857 \`----
792858
859+ x create-once-plugin(after-only): ident visit fn "y": filename: files/2.js
860+ ,-[files/2.js:1:5]
861+ 1 | let y;
862+ : ^
863+ \`----
864+
793865 x create-once-plugin(always-run): ident visit fn "y": filename: files/2.js
794866 ,-[files/2.js:1:5]
795867 1 | let y;
796868 : ^
797869 \`----
798870
799- Found 0 warnings and 26 errors.
871+ x create-once-plugin(before-only): ident visit fn "y": filename: files/2.js
872+ ,-[files/2.js:1:5]
873+ 1 | let y;
874+ : ^
875+ \`----
876+
877+ x create-once-plugin(no-hooks): ident visit fn "y": filename: files/2.js
878+ ,-[files/2.js:1:5]
879+ 1 | let y;
880+ : ^
881+ \`----
882+
883+ Found 0 warnings and 40 errors.
800884Finished in Xms on 2 files using X threads."
801885`;
802886
@@ -825,6 +909,20 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
825909 : ^
826910 \`----
827911
912+ x define-rule-plugin(create-once-after-only): after hook:
913+ | filename: files/1.js
914+ ,-[files/1.js:1:1]
915+ 1 | let a, b;
916+ : ^
917+ \`----
918+
919+ x define-rule-plugin(create-once-before-only): before hook:
920+ | filename: files/1.js
921+ ,-[files/1.js:1:1]
922+ 1 | let a, b;
923+ : ^
924+ \`----
925+
828926 x define-rule-plugin(create): ident visit fn "a":
829927 | filename: files/1.js
830928 ,-[files/1.js:1:5]
@@ -840,6 +938,27 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
840938 : ^
841939 \`----
842940
941+ x define-rule-plugin(create-once-after-only): ident visit fn "a":
942+ | filename: files/1.js
943+ ,-[files/1.js:1:5]
944+ 1 | let a, b;
945+ : ^
946+ \`----
947+
948+ x define-rule-plugin(create-once-before-only): ident visit fn "a":
949+ | filename: files/1.js
950+ ,-[files/1.js:1:5]
951+ 1 | let a, b;
952+ : ^
953+ \`----
954+
955+ x define-rule-plugin(create-once-no-hooks): ident visit fn "a":
956+ | filename: files/1.js
957+ ,-[files/1.js:1:5]
958+ 1 | let a, b;
959+ : ^
960+ \`----
961+
843962 x define-rule-plugin(create): ident visit fn "b":
844963 | filename: files/1.js
845964 ,-[files/1.js:1:8]
@@ -855,6 +974,27 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
855974 : ^
856975 \`----
857976
977+ x define-rule-plugin(create-once-after-only): ident visit fn "b":
978+ | filename: files/1.js
979+ ,-[files/1.js:1:8]
980+ 1 | let a, b;
981+ : ^
982+ \`----
983+
984+ x define-rule-plugin(create-once-before-only): ident visit fn "b":
985+ | filename: files/1.js
986+ ,-[files/1.js:1:8]
987+ 1 | let a, b;
988+ : ^
989+ \`----
990+
991+ x define-rule-plugin(create-once-no-hooks): ident visit fn "b":
992+ | filename: files/1.js
993+ ,-[files/1.js:1:8]
994+ 1 | let a, b;
995+ : ^
996+ \`----
997+
858998 x define-rule-plugin(create): create body:
859999 | this === rule: true
8601000 ,-[files/2.js:1:1]
@@ -878,6 +1018,20 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
8781018 : ^
8791019 \`----
8801020
1021+ x define-rule-plugin(create-once-after-only): after hook:
1022+ | filename: files/2.js
1023+ ,-[files/2.js:1:1]
1024+ 1 | let c, d;
1025+ : ^
1026+ \`----
1027+
1028+ x define-rule-plugin(create-once-before-only): before hook:
1029+ | filename: files/2.js
1030+ ,-[files/2.js:1:1]
1031+ 1 | let c, d;
1032+ : ^
1033+ \`----
1034+
8811035 x define-rule-plugin(create): ident visit fn "c":
8821036 | filename: files/2.js
8831037 ,-[files/2.js:1:5]
@@ -893,6 +1047,27 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
8931047 : ^
8941048 \`----
8951049
1050+ x define-rule-plugin(create-once-after-only): ident visit fn "c":
1051+ | filename: files/2.js
1052+ ,-[files/2.js:1:5]
1053+ 1 | let c, d;
1054+ : ^
1055+ \`----
1056+
1057+ x define-rule-plugin(create-once-before-only): ident visit fn "c":
1058+ | filename: files/2.js
1059+ ,-[files/2.js:1:5]
1060+ 1 | let c, d;
1061+ : ^
1062+ \`----
1063+
1064+ x define-rule-plugin(create-once-no-hooks): ident visit fn "c":
1065+ | filename: files/2.js
1066+ ,-[files/2.js:1:5]
1067+ 1 | let c, d;
1068+ : ^
1069+ \`----
1070+
8961071 x define-rule-plugin(create): ident visit fn "d":
8971072 | filename: files/2.js
8981073 ,-[files/2.js:1:8]
@@ -908,7 +1083,28 @@ exports[`oxlint CLI > should support \`defineRule\` + \`definePlugin\` 1`] = `
9081083 : ^
9091084 \`----
9101085
911- Found 0 warnings and 14 errors.
1086+ x define-rule-plugin(create-once-after-only): ident visit fn "d":
1087+ | filename: files/2.js
1088+ ,-[files/2.js:1:8]
1089+ 1 | let c, d;
1090+ : ^
1091+ \`----
1092+
1093+ x define-rule-plugin(create-once-before-only): ident visit fn "d":
1094+ | filename: files/2.js
1095+ ,-[files/2.js:1:8]
1096+ 1 | let c, d;
1097+ : ^
1098+ \`----
1099+
1100+ x define-rule-plugin(create-once-no-hooks): ident visit fn "d":
1101+ | filename: files/2.js
1102+ ,-[files/2.js:1:8]
1103+ 1 | let c, d;
1104+ : ^
1105+ \`----
1106+
1107+ Found 0 warnings and 30 errors.
9121108Finished in Xms on 2 files using X threads."
9131109`;
9141110
0 commit comments