eslint-plugin-nextfriday 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(index_exports);
40
40
  // package.json
41
41
  var package_default = {
42
42
  name: "eslint-plugin-nextfriday",
43
- version: "4.2.0",
43
+ version: "4.3.0",
44
44
  description: "A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.",
45
45
  keywords: [
46
46
  "eslint",
@@ -525,13 +525,64 @@ var enforceConstantCase = createRule3({
525
525
  });
526
526
  var enforce_constant_case_default = enforceConstantCase;
527
527
 
528
- // src/rules/enforce-hook-naming.ts
528
+ // src/rules/enforce-hook-filename.ts
529
529
  var import_path = __toESM(require("path"), 1);
530
530
  var import_utils6 = require("@typescript-eslint/utils");
531
531
  var createRule4 = import_utils6.ESLintUtils.RuleCreator(
532
532
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
533
533
  );
534
- var enforceHookNaming = createRule4({
534
+ var enforceHookFilename = createRule4({
535
+ name: "enforce-hook-filename",
536
+ meta: {
537
+ type: "suggestion",
538
+ docs: {
539
+ description: "Enforce that files exporting custom hooks are named *.hook.ts or *.hooks.ts"
540
+ },
541
+ messages: {
542
+ requireHookFilename: "'{{ name }}' is a custom hook and must be exported from a *.hook.ts or *.hooks.ts file."
543
+ },
544
+ schema: []
545
+ },
546
+ defaultOptions: [],
547
+ create(context) {
548
+ const basename2 = import_path.default.basename(context.filename);
549
+ const isHookFile = basename2.endsWith(".hook.ts") || basename2.endsWith(".hooks.ts");
550
+ if (isHookFile) return {};
551
+ function reportIfHook(name, node) {
552
+ if (name.startsWith("use") && name.length > 3 && /^use[A-Z]/.test(name)) {
553
+ context.report({ node, messageId: "requireHookFilename", data: { name } });
554
+ }
555
+ }
556
+ return {
557
+ ExportNamedDeclaration(node) {
558
+ if (node.declaration?.type === import_utils6.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
559
+ reportIfHook(node.declaration.id.name, node.declaration.id);
560
+ }
561
+ if (node.declaration?.type === import_utils6.AST_NODE_TYPES.VariableDeclaration) {
562
+ for (const declarator of node.declaration.declarations) {
563
+ if (declarator.id.type === import_utils6.AST_NODE_TYPES.Identifier && declarator.init !== null && (declarator.init.type === import_utils6.AST_NODE_TYPES.ArrowFunctionExpression || declarator.init.type === import_utils6.AST_NODE_TYPES.FunctionExpression)) {
564
+ reportIfHook(declarator.id.name, declarator.id);
565
+ }
566
+ }
567
+ }
568
+ },
569
+ ExportDefaultDeclaration(node) {
570
+ if (node.declaration.type === import_utils6.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id !== null) {
571
+ reportIfHook(node.declaration.id.name, node.declaration.id);
572
+ }
573
+ }
574
+ };
575
+ }
576
+ });
577
+ var enforce_hook_filename_default = enforceHookFilename;
578
+
579
+ // src/rules/enforce-hook-naming.ts
580
+ var import_path2 = __toESM(require("path"), 1);
581
+ var import_utils7 = require("@typescript-eslint/utils");
582
+ var createRule5 = import_utils7.ESLintUtils.RuleCreator(
583
+ (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
584
+ );
585
+ var enforceHookNaming = createRule5({
535
586
  name: "enforce-hook-naming",
536
587
  meta: {
537
588
  type: "suggestion",
@@ -547,7 +598,7 @@ var enforceHookNaming = createRule4({
547
598
  defaultOptions: [],
548
599
  create(context) {
549
600
  const { filename } = context;
550
- const basename2 = import_path.default.basename(filename);
601
+ const basename2 = import_path2.default.basename(filename);
551
602
  const isHookFile = basename2.endsWith(".hook.ts") || basename2.endsWith(".hooks.ts");
552
603
  if (!isHookFile) {
553
604
  return {};
@@ -570,22 +621,22 @@ var enforceHookNaming = createRule4({
570
621
  };
571
622
  return {
572
623
  ExportNamedDeclaration(node) {
573
- if (node.declaration?.type === import_utils6.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
624
+ if (node.declaration?.type === import_utils7.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
574
625
  checkFunctionName(node.declaration.id.name, node.declaration.id, "missingUsePrefix");
575
626
  }
576
- if (node.declaration?.type === import_utils6.AST_NODE_TYPES.VariableDeclaration) {
627
+ if (node.declaration?.type === import_utils7.AST_NODE_TYPES.VariableDeclaration) {
577
628
  node.declaration.declarations.forEach((declarator) => {
578
- if (declarator.id.type === import_utils6.AST_NODE_TYPES.Identifier) {
629
+ if (declarator.id.type === import_utils7.AST_NODE_TYPES.Identifier) {
579
630
  checkFunctionName(declarator.id.name, declarator.id, "missingUsePrefix");
580
631
  }
581
632
  });
582
633
  }
583
634
  },
584
635
  ExportDefaultDeclaration(node) {
585
- if (node.declaration.type === import_utils6.AST_NODE_TYPES.Identifier) {
636
+ if (node.declaration.type === import_utils7.AST_NODE_TYPES.Identifier) {
586
637
  checkFunctionName(node.declaration.name, node.declaration, "defaultExportMissingUsePrefix");
587
638
  }
588
- if (node.declaration.type === import_utils6.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
639
+ if (node.declaration.type === import_utils7.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
589
640
  checkFunctionName(node.declaration.id.name, node.declaration.id, "defaultExportMissingUsePrefix");
590
641
  }
591
642
  }
@@ -595,26 +646,26 @@ var enforceHookNaming = createRule4({
595
646
  var enforce_hook_naming_default = enforceHookNaming;
596
647
 
597
648
  // src/rules/enforce-property-case.ts
598
- var import_utils7 = require("@typescript-eslint/utils");
599
- var createRule5 = import_utils7.ESLintUtils.RuleCreator(
649
+ var import_utils8 = require("@typescript-eslint/utils");
650
+ var createRule6 = import_utils8.ESLintUtils.RuleCreator(
600
651
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
601
652
  );
602
653
  var SNAKE_CASE_REGEX3 = /^[a-z]+_[a-z0-9_]*$/;
603
654
  var SCREAMING_SNAKE_CASE_REGEX2 = /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$/;
604
655
  var isInsideAsConst = (node) => {
605
656
  const { parent } = node;
606
- if (parent.type === import_utils7.AST_NODE_TYPES.TSAsExpression && parent.typeAnnotation.type === import_utils7.AST_NODE_TYPES.TSTypeReference && parent.typeAnnotation.typeName.type === import_utils7.AST_NODE_TYPES.Identifier && parent.typeAnnotation.typeName.name === "const") {
657
+ if (parent.type === import_utils8.AST_NODE_TYPES.TSAsExpression && parent.typeAnnotation.type === import_utils8.AST_NODE_TYPES.TSTypeReference && parent.typeAnnotation.typeName.type === import_utils8.AST_NODE_TYPES.Identifier && parent.typeAnnotation.typeName.name === "const") {
607
658
  return true;
608
659
  }
609
- if (parent.type === import_utils7.AST_NODE_TYPES.ArrayExpression) {
660
+ if (parent.type === import_utils8.AST_NODE_TYPES.ArrayExpression) {
610
661
  const grandparent = parent.parent;
611
- if (grandparent?.type === import_utils7.AST_NODE_TYPES.TSAsExpression && grandparent.typeAnnotation.type === import_utils7.AST_NODE_TYPES.TSTypeReference && grandparent.typeAnnotation.typeName.type === import_utils7.AST_NODE_TYPES.Identifier && grandparent.typeAnnotation.typeName.name === "const") {
662
+ if (grandparent?.type === import_utils8.AST_NODE_TYPES.TSAsExpression && grandparent.typeAnnotation.type === import_utils8.AST_NODE_TYPES.TSTypeReference && grandparent.typeAnnotation.typeName.type === import_utils8.AST_NODE_TYPES.Identifier && grandparent.typeAnnotation.typeName.name === "const") {
612
663
  return true;
613
664
  }
614
665
  }
615
666
  return false;
616
667
  };
617
- var enforcePropertyCase = createRule5({
668
+ var enforcePropertyCase = createRule6({
618
669
  name: "enforce-property-case",
619
670
  meta: {
620
671
  type: "suggestion",
@@ -630,7 +681,7 @@ var enforcePropertyCase = createRule5({
630
681
  create(context) {
631
682
  return {
632
683
  Property(node) {
633
- if (node.parent.type !== import_utils7.AST_NODE_TYPES.ObjectExpression) {
684
+ if (node.parent.type !== import_utils8.AST_NODE_TYPES.ObjectExpression) {
634
685
  return;
635
686
  }
636
687
  if (isInsideAsConst(node.parent)) {
@@ -639,7 +690,7 @@ var enforcePropertyCase = createRule5({
639
690
  if (node.computed) {
640
691
  return;
641
692
  }
642
- if (node.key.type !== import_utils7.AST_NODE_TYPES.Identifier) {
693
+ if (node.key.type !== import_utils8.AST_NODE_TYPES.Identifier) {
643
694
  return;
644
695
  }
645
696
  const { name } = node.key;
@@ -657,12 +708,12 @@ var enforcePropertyCase = createRule5({
657
708
  var enforce_property_case_default = enforcePropertyCase;
658
709
 
659
710
  // src/rules/enforce-props-suffix.ts
660
- var import_path2 = __toESM(require("path"), 1);
661
- var import_utils8 = require("@typescript-eslint/utils");
662
- var createRule6 = import_utils8.ESLintUtils.RuleCreator(
711
+ var import_path3 = __toESM(require("path"), 1);
712
+ var import_utils9 = require("@typescript-eslint/utils");
713
+ var createRule7 = import_utils9.ESLintUtils.RuleCreator(
663
714
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
664
715
  );
665
- var enforcePropsSuffix = createRule6({
716
+ var enforcePropsSuffix = createRule7({
666
717
  name: "enforce-props-suffix",
667
718
  meta: {
668
719
  type: "suggestion",
@@ -677,7 +728,7 @@ var enforcePropsSuffix = createRule6({
677
728
  defaultOptions: [],
678
729
  create(context) {
679
730
  const { filename } = context;
680
- const ext = import_path2.default.extname(filename);
731
+ const ext = import_path3.default.extname(filename);
681
732
  const isComponentFile = ext === ".tsx" || ext === ".jsx";
682
733
  if (!isComponentFile) {
683
734
  return {};
@@ -696,13 +747,13 @@ var enforcePropsSuffix = createRule6({
696
747
  };
697
748
  return {
698
749
  TSInterfaceDeclaration(node) {
699
- if (node.id.type === import_utils8.AST_NODE_TYPES.Identifier) {
750
+ if (node.id.type === import_utils9.AST_NODE_TYPES.Identifier) {
700
751
  checkTypeName(node.id.name, node.id);
701
752
  }
702
753
  },
703
754
  TSTypeAliasDeclaration(node) {
704
- if (node.id.type === import_utils8.AST_NODE_TYPES.Identifier) {
705
- if (node.typeAnnotation.type === import_utils8.AST_NODE_TYPES.TSTypeLiteral) {
755
+ if (node.id.type === import_utils9.AST_NODE_TYPES.Identifier) {
756
+ if (node.typeAnnotation.type === import_utils9.AST_NODE_TYPES.TSTypeLiteral) {
706
757
  checkTypeName(node.id.name, node.id);
707
758
  }
708
759
  }
@@ -713,11 +764,11 @@ var enforcePropsSuffix = createRule6({
713
764
  var enforce_props_suffix_default = enforcePropsSuffix;
714
765
 
715
766
  // src/rules/enforce-readonly-component-props.ts
716
- var import_utils9 = require("@typescript-eslint/utils");
717
- var createRule7 = import_utils9.ESLintUtils.RuleCreator(
767
+ var import_utils10 = require("@typescript-eslint/utils");
768
+ var createRule8 = import_utils10.ESLintUtils.RuleCreator(
718
769
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
719
770
  );
720
- var enforceReadonlyComponentProps = createRule7({
771
+ var enforceReadonlyComponentProps = createRule8({
721
772
  name: "enforce-readonly-component-props",
722
773
  meta: {
723
774
  type: "suggestion",
@@ -733,40 +784,40 @@ var enforceReadonlyComponentProps = createRule7({
733
784
  defaultOptions: [],
734
785
  create(context) {
735
786
  function hasJSXInConditional(node) {
736
- return node.consequent.type === import_utils9.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils9.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils9.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils9.AST_NODE_TYPES.JSXFragment;
787
+ return node.consequent.type === import_utils10.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils10.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils10.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils10.AST_NODE_TYPES.JSXFragment;
737
788
  }
738
789
  function hasJSXInLogical(node) {
739
- return node.right.type === import_utils9.AST_NODE_TYPES.JSXElement || node.right.type === import_utils9.AST_NODE_TYPES.JSXFragment;
790
+ return node.right.type === import_utils10.AST_NODE_TYPES.JSXElement || node.right.type === import_utils10.AST_NODE_TYPES.JSXFragment;
740
791
  }
741
792
  function hasJSXReturn(block) {
742
793
  return block.body.some((stmt) => {
743
- if (stmt.type === import_utils9.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
744
- return stmt.argument.type === import_utils9.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils9.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils9.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils9.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
794
+ if (stmt.type === import_utils10.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
795
+ return stmt.argument.type === import_utils10.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils10.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils10.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils10.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
745
796
  }
746
797
  return false;
747
798
  });
748
799
  }
749
800
  function isReactComponent2(node) {
750
- if (node.type === import_utils9.AST_NODE_TYPES.ArrowFunctionExpression) {
751
- if (node.body.type === import_utils9.AST_NODE_TYPES.JSXElement || node.body.type === import_utils9.AST_NODE_TYPES.JSXFragment) {
801
+ if (node.type === import_utils10.AST_NODE_TYPES.ArrowFunctionExpression) {
802
+ if (node.body.type === import_utils10.AST_NODE_TYPES.JSXElement || node.body.type === import_utils10.AST_NODE_TYPES.JSXFragment) {
752
803
  return true;
753
804
  }
754
- if (node.body.type === import_utils9.AST_NODE_TYPES.BlockStatement) {
805
+ if (node.body.type === import_utils10.AST_NODE_TYPES.BlockStatement) {
755
806
  return hasJSXReturn(node.body);
756
807
  }
757
- } else if (node.type === import_utils9.AST_NODE_TYPES.FunctionExpression || node.type === import_utils9.AST_NODE_TYPES.FunctionDeclaration) {
758
- if (node.body && node.body.type === import_utils9.AST_NODE_TYPES.BlockStatement) {
808
+ } else if (node.type === import_utils10.AST_NODE_TYPES.FunctionExpression || node.type === import_utils10.AST_NODE_TYPES.FunctionDeclaration) {
809
+ if (node.body && node.body.type === import_utils10.AST_NODE_TYPES.BlockStatement) {
759
810
  return hasJSXReturn(node.body);
760
811
  }
761
812
  }
762
813
  return false;
763
814
  }
764
815
  function isNamedType(node) {
765
- return node.type === import_utils9.AST_NODE_TYPES.TSTypeReference;
816
+ return node.type === import_utils10.AST_NODE_TYPES.TSTypeReference;
766
817
  }
767
818
  function isAlreadyReadonly(node) {
768
- if (node.type === import_utils9.AST_NODE_TYPES.TSTypeReference && node.typeName) {
769
- if (node.typeName.type === import_utils9.AST_NODE_TYPES.Identifier && node.typeName.name === "Readonly") {
819
+ if (node.type === import_utils10.AST_NODE_TYPES.TSTypeReference && node.typeName) {
820
+ if (node.typeName.type === import_utils10.AST_NODE_TYPES.Identifier && node.typeName.name === "Readonly") {
770
821
  return true;
771
822
  }
772
823
  }
@@ -780,7 +831,7 @@ var enforceReadonlyComponentProps = createRule7({
780
831
  return;
781
832
  }
782
833
  const param = node.params[0];
783
- if (param.type === import_utils9.AST_NODE_TYPES.Identifier && param.typeAnnotation) {
834
+ if (param.type === import_utils10.AST_NODE_TYPES.Identifier && param.typeAnnotation) {
784
835
  const { typeAnnotation } = param.typeAnnotation;
785
836
  if (isNamedType(typeAnnotation) && !isAlreadyReadonly(typeAnnotation)) {
786
837
  const { sourceCode } = context;
@@ -805,8 +856,8 @@ var enforceReadonlyComponentProps = createRule7({
805
856
  var enforce_readonly_component_props_default = enforceReadonlyComponentProps;
806
857
 
807
858
  // src/rules/enforce-render-naming.ts
808
- var import_utils10 = require("@typescript-eslint/utils");
809
- var createRule8 = import_utils10.ESLintUtils.RuleCreator(
859
+ var import_utils11 = require("@typescript-eslint/utils");
860
+ var createRule9 = import_utils11.ESLintUtils.RuleCreator(
810
861
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
811
862
  );
812
863
  var ARRAY_RETURNING_METHODS = /* @__PURE__ */ new Set(["map", "flatMap", "filter"]);
@@ -821,20 +872,20 @@ function hasRenderPrefix(name) {
821
872
  return nextChar === nextChar.toUpperCase() && nextChar !== nextChar.toLowerCase();
822
873
  }
823
874
  function functionBodyReturnsJsx(body) {
824
- if (body.type === import_utils10.AST_NODE_TYPES.JSXElement || body.type === import_utils10.AST_NODE_TYPES.JSXFragment) {
875
+ if (body.type === import_utils11.AST_NODE_TYPES.JSXElement || body.type === import_utils11.AST_NODE_TYPES.JSXFragment) {
825
876
  return true;
826
877
  }
827
- if (body.type === import_utils10.AST_NODE_TYPES.ConditionalExpression) {
878
+ if (body.type === import_utils11.AST_NODE_TYPES.ConditionalExpression) {
828
879
  return isJsxProducingExpression(body.consequent) || isJsxProducingExpression(body.alternate);
829
880
  }
830
- if (body.type === import_utils10.AST_NODE_TYPES.LogicalExpression) {
881
+ if (body.type === import_utils11.AST_NODE_TYPES.LogicalExpression) {
831
882
  return isJsxProducingExpression(body.right);
832
883
  }
833
- if (body.type !== import_utils10.AST_NODE_TYPES.BlockStatement) {
884
+ if (body.type !== import_utils11.AST_NODE_TYPES.BlockStatement) {
834
885
  return false;
835
886
  }
836
887
  for (const statement of body.body) {
837
- if (statement.type === import_utils10.AST_NODE_TYPES.ReturnStatement && statement.argument) {
888
+ if (statement.type === import_utils11.AST_NODE_TYPES.ReturnStatement && statement.argument) {
838
889
  if (isJsxProducingExpression(statement.argument)) {
839
890
  return true;
840
891
  }
@@ -843,35 +894,35 @@ function functionBodyReturnsJsx(body) {
843
894
  return false;
844
895
  }
845
896
  function isJsxProducingExpression(node) {
846
- if (node.type === import_utils10.AST_NODE_TYPES.JSXElement || node.type === import_utils10.AST_NODE_TYPES.JSXFragment) {
897
+ if (node.type === import_utils11.AST_NODE_TYPES.JSXElement || node.type === import_utils11.AST_NODE_TYPES.JSXFragment) {
847
898
  return true;
848
899
  }
849
- if (node.type === import_utils10.AST_NODE_TYPES.ConditionalExpression) {
900
+ if (node.type === import_utils11.AST_NODE_TYPES.ConditionalExpression) {
850
901
  return isJsxProducingExpression(node.consequent) || isJsxProducingExpression(node.alternate);
851
902
  }
852
- if (node.type === import_utils10.AST_NODE_TYPES.LogicalExpression) {
903
+ if (node.type === import_utils11.AST_NODE_TYPES.LogicalExpression) {
853
904
  return isJsxProducingExpression(node.right);
854
905
  }
855
- if (node.type === import_utils10.AST_NODE_TYPES.ArrayExpression) {
906
+ if (node.type === import_utils11.AST_NODE_TYPES.ArrayExpression) {
856
907
  return node.elements.some((element) => {
857
- if (!element || element.type === import_utils10.AST_NODE_TYPES.SpreadElement) {
908
+ if (!element || element.type === import_utils11.AST_NODE_TYPES.SpreadElement) {
858
909
  return false;
859
910
  }
860
911
  return isJsxProducingExpression(element);
861
912
  });
862
913
  }
863
- if (node.type === import_utils10.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils10.AST_NODE_TYPES.FunctionExpression) {
914
+ if (node.type === import_utils11.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils11.AST_NODE_TYPES.FunctionExpression) {
864
915
  return functionBodyReturnsJsx(node.body);
865
916
  }
866
- if (node.type === import_utils10.AST_NODE_TYPES.CallExpression) {
867
- if (node.callee.type === import_utils10.AST_NODE_TYPES.MemberExpression && node.callee.property.type === import_utils10.AST_NODE_TYPES.Identifier && ARRAY_RETURNING_METHODS.has(node.callee.property.name)) {
917
+ if (node.type === import_utils11.AST_NODE_TYPES.CallExpression) {
918
+ if (node.callee.type === import_utils11.AST_NODE_TYPES.MemberExpression && node.callee.property.type === import_utils11.AST_NODE_TYPES.Identifier && ARRAY_RETURNING_METHODS.has(node.callee.property.name)) {
868
919
  const callback = node.arguments[0];
869
- if (callback && (callback.type === import_utils10.AST_NODE_TYPES.ArrowFunctionExpression || callback.type === import_utils10.AST_NODE_TYPES.FunctionExpression)) {
920
+ if (callback && (callback.type === import_utils11.AST_NODE_TYPES.ArrowFunctionExpression || callback.type === import_utils11.AST_NODE_TYPES.FunctionExpression)) {
870
921
  return functionBodyReturnsJsx(callback.body);
871
922
  }
872
923
  }
873
924
  }
874
- if (node.type === import_utils10.AST_NODE_TYPES.TSAsExpression || node.type === import_utils10.AST_NODE_TYPES.TSSatisfiesExpression) {
925
+ if (node.type === import_utils11.AST_NODE_TYPES.TSAsExpression || node.type === import_utils11.AST_NODE_TYPES.TSSatisfiesExpression) {
875
926
  return isJsxProducingExpression(node.expression);
876
927
  }
877
928
  return false;
@@ -880,16 +931,16 @@ function isPascalCase(name) {
880
931
  return /^[A-Z]/.test(name);
881
932
  }
882
933
  function isComponentFunction2(node) {
883
- if (node.type === import_utils10.AST_NODE_TYPES.FunctionDeclaration && node.id && isPascalCase(node.id.name)) {
934
+ if (node.type === import_utils11.AST_NODE_TYPES.FunctionDeclaration && node.id && isPascalCase(node.id.name)) {
884
935
  return true;
885
936
  }
886
937
  const parent = node.parent;
887
- if (parent?.type === import_utils10.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils10.AST_NODE_TYPES.Identifier && isPascalCase(parent.id.name)) {
938
+ if (parent?.type === import_utils11.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils11.AST_NODE_TYPES.Identifier && isPascalCase(parent.id.name)) {
888
939
  return true;
889
940
  }
890
941
  return false;
891
942
  }
892
- var enforceRenderNaming = createRule8({
943
+ var enforceRenderNaming = createRule9({
893
944
  name: "enforce-render-naming",
894
945
  meta: {
895
946
  type: "problem",
@@ -929,7 +980,7 @@ var enforceRenderNaming = createRule8({
929
980
  if (!isInsideComponent()) {
930
981
  return;
931
982
  }
932
- if (node.id.type !== import_utils10.AST_NODE_TYPES.Identifier) {
983
+ if (node.id.type !== import_utils11.AST_NODE_TYPES.Identifier) {
933
984
  return;
934
985
  }
935
986
  if (!node.init) {
@@ -955,8 +1006,8 @@ var enforceRenderNaming = createRule8({
955
1006
  var enforce_render_naming_default = enforceRenderNaming;
956
1007
 
957
1008
  // src/rules/enforce-service-naming.ts
958
- var import_utils12 = require("@typescript-eslint/utils");
959
- var createRule9 = import_utils12.ESLintUtils.RuleCreator(
1009
+ var import_utils13 = require("@typescript-eslint/utils");
1010
+ var createRule10 = import_utils13.ESLintUtils.RuleCreator(
960
1011
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
961
1012
  );
962
1013
  var BANNED_PREFIXES = {
@@ -965,7 +1016,7 @@ var BANNED_PREFIXES = {
965
1016
  handle: ["create", "verify"],
966
1017
  set: ["update", "save", "patch"]
967
1018
  };
968
- var enforceServiceNaming = createRule9({
1019
+ var enforceServiceNaming = createRule10({
969
1020
  name: "enforce-service-naming",
970
1021
  meta: {
971
1022
  type: "suggestion",
@@ -1008,12 +1059,12 @@ var enforceServiceNaming = createRule9({
1008
1059
  };
1009
1060
  return {
1010
1061
  ExportNamedDeclaration(node) {
1011
- if (node.declaration?.type === import_utils12.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
1062
+ if (node.declaration?.type === import_utils13.AST_NODE_TYPES.FunctionDeclaration && node.declaration.id) {
1012
1063
  checkExportedFunction(node.declaration, node.declaration.id);
1013
1064
  }
1014
- if (node.declaration?.type === import_utils12.AST_NODE_TYPES.VariableDeclaration) {
1065
+ if (node.declaration?.type === import_utils13.AST_NODE_TYPES.VariableDeclaration) {
1015
1066
  node.declaration.declarations.forEach((declarator) => {
1016
- if (declarator.id.type === import_utils12.AST_NODE_TYPES.Identifier && declarator.init?.type === import_utils12.AST_NODE_TYPES.ArrowFunctionExpression) {
1067
+ if (declarator.id.type === import_utils13.AST_NODE_TYPES.Identifier && declarator.init?.type === import_utils13.AST_NODE_TYPES.ArrowFunctionExpression) {
1017
1068
  checkExportedFunction(declarator.init, declarator.id);
1018
1069
  }
1019
1070
  });
@@ -1024,12 +1075,52 @@ var enforceServiceNaming = createRule9({
1024
1075
  });
1025
1076
  var enforce_service_naming_default = enforceServiceNaming;
1026
1077
 
1078
+ // src/rules/enforce-test-filename.ts
1079
+ var import_path4 = __toESM(require("path"), 1);
1080
+ var import_utils14 = require("@typescript-eslint/utils");
1081
+ var createRule11 = import_utils14.ESLintUtils.RuleCreator(
1082
+ (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1083
+ );
1084
+ var TEST_GLOBALS = /* @__PURE__ */ new Set(["describe", "it", "test", "beforeEach", "beforeAll", "afterEach", "afterAll"]);
1085
+ var enforceTestFilename = createRule11({
1086
+ name: "enforce-test-filename",
1087
+ meta: {
1088
+ type: "suggestion",
1089
+ docs: {
1090
+ description: "Enforce that files containing test code are named *.test.ts or *.test.tsx"
1091
+ },
1092
+ messages: {
1093
+ requireTestFilename: "Files containing test code must be named *.test.ts or *.test.tsx."
1094
+ },
1095
+ schema: []
1096
+ },
1097
+ defaultOptions: [],
1098
+ create(context) {
1099
+ const basename2 = import_path4.default.basename(context.filename);
1100
+ const isTestFile = basename2.endsWith(".test.ts") || basename2.endsWith(".test.tsx");
1101
+ if (isTestFile) return {};
1102
+ function isTestGlobalCall(node) {
1103
+ return node.callee.type === import_utils14.AST_NODE_TYPES.Identifier && TEST_GLOBALS.has(node.callee.name);
1104
+ }
1105
+ let reported = false;
1106
+ return {
1107
+ CallExpression(node) {
1108
+ if (reported) return;
1109
+ if (!isTestGlobalCall(node)) return;
1110
+ reported = true;
1111
+ context.report({ node, messageId: "requireTestFilename" });
1112
+ }
1113
+ };
1114
+ }
1115
+ });
1116
+ var enforce_test_filename_default = enforceTestFilename;
1117
+
1027
1118
  // src/rules/enforce-sorted-destructuring.ts
1028
- var import_utils13 = require("@typescript-eslint/utils");
1029
- var createRule10 = import_utils13.ESLintUtils.RuleCreator(
1119
+ var import_utils15 = require("@typescript-eslint/utils");
1120
+ var createRule12 = import_utils15.ESLintUtils.RuleCreator(
1030
1121
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1031
1122
  );
1032
- var enforceSortedDestructuring = createRule10({
1123
+ var enforceSortedDestructuring = createRule12({
1033
1124
  name: "enforce-sorted-destructuring",
1034
1125
  meta: {
1035
1126
  type: "suggestion",
@@ -1045,19 +1136,19 @@ var enforceSortedDestructuring = createRule10({
1045
1136
  defaultOptions: [],
1046
1137
  create(context) {
1047
1138
  function getPropertyName(property) {
1048
- if (property.type === import_utils13.AST_NODE_TYPES.RestElement) {
1139
+ if (property.type === import_utils15.AST_NODE_TYPES.RestElement) {
1049
1140
  return null;
1050
1141
  }
1051
- if (property.key.type === import_utils13.AST_NODE_TYPES.Identifier) {
1142
+ if (property.key.type === import_utils15.AST_NODE_TYPES.Identifier) {
1052
1143
  return property.key.name;
1053
1144
  }
1054
1145
  return null;
1055
1146
  }
1056
1147
  function hasDefaultValue(property) {
1057
- return property.value.type === import_utils13.AST_NODE_TYPES.AssignmentPattern && Boolean(property.value.right);
1148
+ return property.value.type === import_utils15.AST_NODE_TYPES.AssignmentPattern && Boolean(property.value.right);
1058
1149
  }
1059
1150
  function checkVariableDeclarator(node) {
1060
- if (node.id.type !== import_utils13.AST_NODE_TYPES.ObjectPattern) {
1151
+ if (node.id.type !== import_utils15.AST_NODE_TYPES.ObjectPattern) {
1061
1152
  return;
1062
1153
  }
1063
1154
  const { properties } = node.id;
@@ -1065,7 +1156,7 @@ var enforceSortedDestructuring = createRule10({
1065
1156
  return;
1066
1157
  }
1067
1158
  const propertyInfo = properties.map((prop) => {
1068
- if (prop.type === import_utils13.AST_NODE_TYPES.RestElement) {
1159
+ if (prop.type === import_utils15.AST_NODE_TYPES.RestElement) {
1069
1160
  return null;
1070
1161
  }
1071
1162
  return {
@@ -1104,20 +1195,20 @@ var enforceSortedDestructuring = createRule10({
1104
1195
  var enforce_sorted_destructuring_default = enforceSortedDestructuring;
1105
1196
 
1106
1197
  // src/rules/enforce-type-declaration-order.ts
1107
- var import_utils14 = require("@typescript-eslint/utils");
1108
- var createRule11 = import_utils14.ESLintUtils.RuleCreator(
1198
+ var import_utils16 = require("@typescript-eslint/utils");
1199
+ var createRule13 = import_utils16.ESLintUtils.RuleCreator(
1109
1200
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1110
1201
  );
1111
1202
  function getTypeDeclarationName(node) {
1112
- if (node.type === import_utils14.AST_NODE_TYPES.TSInterfaceDeclaration && node.id.type === import_utils14.AST_NODE_TYPES.Identifier) {
1203
+ if (node.type === import_utils16.AST_NODE_TYPES.TSInterfaceDeclaration && node.id.type === import_utils16.AST_NODE_TYPES.Identifier) {
1113
1204
  return { name: node.id.name, position: node.range[0] };
1114
1205
  }
1115
- if (node.type === import_utils14.AST_NODE_TYPES.TSTypeAliasDeclaration && node.id.type === import_utils14.AST_NODE_TYPES.Identifier) {
1206
+ if (node.type === import_utils16.AST_NODE_TYPES.TSTypeAliasDeclaration && node.id.type === import_utils16.AST_NODE_TYPES.Identifier) {
1116
1207
  return { name: node.id.name, position: node.range[0] };
1117
1208
  }
1118
1209
  return null;
1119
1210
  }
1120
- var enforceTypeDeclarationOrder = createRule11({
1211
+ var enforceTypeDeclarationOrder = createRule13({
1121
1212
  name: "enforce-type-declaration-order",
1122
1213
  meta: {
1123
1214
  type: "suggestion",
@@ -1148,7 +1239,7 @@ var enforceTypeDeclarationOrder = createRule11({
1148
1239
  }
1149
1240
  },
1150
1241
  "TSPropertySignature TSTypeReference": function checkTypeReference(node) {
1151
- if (node.typeName.type !== import_utils14.AST_NODE_TYPES.Identifier) {
1242
+ if (node.typeName.type !== import_utils16.AST_NODE_TYPES.Identifier) {
1152
1243
  return;
1153
1244
  }
1154
1245
  const referencedName = node.typeName.name;
@@ -1185,8 +1276,8 @@ var enforceTypeDeclarationOrder = createRule11({
1185
1276
  var enforce_type_declaration_order_default = enforceTypeDeclarationOrder;
1186
1277
 
1187
1278
  // src/rules/index-export-only.ts
1188
- var import_utils15 = require("@typescript-eslint/utils");
1189
- var createRule12 = import_utils15.ESLintUtils.RuleCreator(
1279
+ var import_utils17 = require("@typescript-eslint/utils");
1280
+ var createRule14 = import_utils17.ESLintUtils.RuleCreator(
1190
1281
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1191
1282
  );
1192
1283
  var isIndexFile = (filename) => getBaseName(filename) === "index";
@@ -1194,26 +1285,26 @@ var isAllowedExportNamed = (node) => {
1194
1285
  if (!node.declaration) {
1195
1286
  return true;
1196
1287
  }
1197
- return node.declaration.type === import_utils15.AST_NODE_TYPES.TSTypeAliasDeclaration || node.declaration.type === import_utils15.AST_NODE_TYPES.TSInterfaceDeclaration;
1288
+ return node.declaration.type === import_utils17.AST_NODE_TYPES.TSTypeAliasDeclaration || node.declaration.type === import_utils17.AST_NODE_TYPES.TSInterfaceDeclaration;
1198
1289
  };
1199
- var isAllowedExportDefault = (node) => node.declaration.type === import_utils15.AST_NODE_TYPES.Identifier;
1290
+ var isAllowedExportDefault = (node) => node.declaration.type === import_utils17.AST_NODE_TYPES.Identifier;
1200
1291
  var isAllowedTopLevel = (node) => {
1201
1292
  switch (node.type) {
1202
- case import_utils15.AST_NODE_TYPES.ImportDeclaration:
1203
- case import_utils15.AST_NODE_TYPES.ExportAllDeclaration:
1204
- case import_utils15.AST_NODE_TYPES.TSTypeAliasDeclaration:
1205
- case import_utils15.AST_NODE_TYPES.TSInterfaceDeclaration:
1206
- case import_utils15.AST_NODE_TYPES.TSImportEqualsDeclaration:
1293
+ case import_utils17.AST_NODE_TYPES.ImportDeclaration:
1294
+ case import_utils17.AST_NODE_TYPES.ExportAllDeclaration:
1295
+ case import_utils17.AST_NODE_TYPES.TSTypeAliasDeclaration:
1296
+ case import_utils17.AST_NODE_TYPES.TSInterfaceDeclaration:
1297
+ case import_utils17.AST_NODE_TYPES.TSImportEqualsDeclaration:
1207
1298
  return true;
1208
- case import_utils15.AST_NODE_TYPES.ExportNamedDeclaration:
1299
+ case import_utils17.AST_NODE_TYPES.ExportNamedDeclaration:
1209
1300
  return isAllowedExportNamed(node);
1210
- case import_utils15.AST_NODE_TYPES.ExportDefaultDeclaration:
1301
+ case import_utils17.AST_NODE_TYPES.ExportDefaultDeclaration:
1211
1302
  return isAllowedExportDefault(node);
1212
1303
  default:
1213
1304
  return false;
1214
1305
  }
1215
1306
  };
1216
- var indexExportOnly = createRule12({
1307
+ var indexExportOnly = createRule14({
1217
1308
  name: "index-export-only",
1218
1309
  meta: {
1219
1310
  type: "suggestion",
@@ -1247,11 +1338,11 @@ var indexExportOnly = createRule12({
1247
1338
  var index_export_only_default = indexExportOnly;
1248
1339
 
1249
1340
  // src/rules/jsx-newline-between-elements.ts
1250
- var import_utils17 = require("@typescript-eslint/utils");
1251
- var createRule13 = import_utils17.ESLintUtils.RuleCreator(
1341
+ var import_utils19 = require("@typescript-eslint/utils");
1342
+ var createRule15 = import_utils19.ESLintUtils.RuleCreator(
1252
1343
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1253
1344
  );
1254
- var jsxNewlineBetweenElements = createRule13({
1345
+ var jsxNewlineBetweenElements = createRule15({
1255
1346
  name: "jsx-newline-between-elements",
1256
1347
  meta: {
1257
1348
  type: "layout",
@@ -1269,7 +1360,7 @@ var jsxNewlineBetweenElements = createRule13({
1269
1360
  create(context) {
1270
1361
  const { sourceCode } = context;
1271
1362
  function isSignificantJSXChild(node) {
1272
- return node.type === import_utils17.AST_NODE_TYPES.JSXElement || node.type === import_utils17.AST_NODE_TYPES.JSXFragment || node.type === import_utils17.AST_NODE_TYPES.JSXExpressionContainer;
1363
+ return node.type === import_utils19.AST_NODE_TYPES.JSXElement || node.type === import_utils19.AST_NODE_TYPES.JSXFragment || node.type === import_utils19.AST_NODE_TYPES.JSXExpressionContainer;
1273
1364
  }
1274
1365
  function isMultiLine(node) {
1275
1366
  return node.loc.start.line !== node.loc.end.line;
@@ -1319,18 +1410,18 @@ var jsxNewlineBetweenElements = createRule13({
1319
1410
  var jsx_newline_between_elements_default = jsxNewlineBetweenElements;
1320
1411
 
1321
1412
  // src/rules/jsx-no-data-array.ts
1322
- var import_utils18 = require("@typescript-eslint/utils");
1323
- var createRule14 = import_utils18.ESLintUtils.RuleCreator(
1413
+ var import_utils20 = require("@typescript-eslint/utils");
1414
+ var createRule16 = import_utils20.ESLintUtils.RuleCreator(
1324
1415
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1325
1416
  );
1326
1417
  function isObjectLikeElement(node) {
1327
1418
  if (!node) {
1328
1419
  return false;
1329
1420
  }
1330
- if (node.type === import_utils18.AST_NODE_TYPES.ObjectExpression) {
1421
+ if (node.type === import_utils20.AST_NODE_TYPES.ObjectExpression) {
1331
1422
  return true;
1332
1423
  }
1333
- if (node.type === import_utils18.AST_NODE_TYPES.TSAsExpression || node.type === import_utils18.AST_NODE_TYPES.TSSatisfiesExpression) {
1424
+ if (node.type === import_utils20.AST_NODE_TYPES.TSAsExpression || node.type === import_utils20.AST_NODE_TYPES.TSSatisfiesExpression) {
1334
1425
  return isObjectLikeElement(node.expression);
1335
1426
  }
1336
1427
  return false;
@@ -1339,15 +1430,15 @@ function getArrayInitializer(init) {
1339
1430
  if (!init) {
1340
1431
  return null;
1341
1432
  }
1342
- if (init.type === import_utils18.AST_NODE_TYPES.ArrayExpression) {
1433
+ if (init.type === import_utils20.AST_NODE_TYPES.ArrayExpression) {
1343
1434
  return init;
1344
1435
  }
1345
- if (init.type === import_utils18.AST_NODE_TYPES.TSAsExpression || init.type === import_utils18.AST_NODE_TYPES.TSSatisfiesExpression) {
1436
+ if (init.type === import_utils20.AST_NODE_TYPES.TSAsExpression || init.type === import_utils20.AST_NODE_TYPES.TSSatisfiesExpression) {
1346
1437
  return getArrayInitializer(init.expression);
1347
1438
  }
1348
1439
  return null;
1349
1440
  }
1350
- var jsxNoDataArray = createRule14({
1441
+ var jsxNoDataArray = createRule16({
1351
1442
  name: "jsx-no-data-array",
1352
1443
  meta: {
1353
1444
  type: "problem",
@@ -1376,7 +1467,7 @@ var jsxNoDataArray = createRule14({
1376
1467
  if (!hasObjectElement) {
1377
1468
  return;
1378
1469
  }
1379
- const name = node.id.type === import_utils18.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1470
+ const name = node.id.type === import_utils20.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1380
1471
  context.report({
1381
1472
  node,
1382
1473
  messageId: "noDataArray",
@@ -1392,7 +1483,7 @@ var jsxNoDataArray = createRule14({
1392
1483
  if (!hasObjectElement) {
1393
1484
  return;
1394
1485
  }
1395
- const name = node.id.type === import_utils18.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1486
+ const name = node.id.type === import_utils20.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1396
1487
  context.report({
1397
1488
  node,
1398
1489
  messageId: "noDataArray",
@@ -1405,15 +1496,15 @@ var jsxNoDataArray = createRule14({
1405
1496
  var jsx_no_data_array_default = jsxNoDataArray;
1406
1497
 
1407
1498
  // src/rules/jsx-no-data-object.ts
1408
- var import_utils20 = require("@typescript-eslint/utils");
1409
- var createRule15 = import_utils20.ESLintUtils.RuleCreator(
1499
+ var import_utils22 = require("@typescript-eslint/utils");
1500
+ var createRule17 = import_utils22.ESLintUtils.RuleCreator(
1410
1501
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1411
1502
  );
1412
1503
  function unwrapAssertion(node) {
1413
1504
  if (!node) {
1414
1505
  return null;
1415
1506
  }
1416
- if (node.type === import_utils20.AST_NODE_TYPES.TSAsExpression || node.type === import_utils20.AST_NODE_TYPES.TSSatisfiesExpression) {
1507
+ if (node.type === import_utils22.AST_NODE_TYPES.TSAsExpression || node.type === import_utils22.AST_NODE_TYPES.TSSatisfiesExpression) {
1417
1508
  return unwrapAssertion(node.expression);
1418
1509
  }
1419
1510
  return node;
@@ -1423,26 +1514,26 @@ function isNestedValue(value) {
1423
1514
  if (!unwrapped) {
1424
1515
  return false;
1425
1516
  }
1426
- if (unwrapped.type === import_utils20.AST_NODE_TYPES.ObjectExpression) {
1517
+ if (unwrapped.type === import_utils22.AST_NODE_TYPES.ObjectExpression) {
1427
1518
  return true;
1428
1519
  }
1429
- if (unwrapped.type === import_utils20.AST_NODE_TYPES.ArrayExpression) {
1520
+ if (unwrapped.type === import_utils22.AST_NODE_TYPES.ArrayExpression) {
1430
1521
  return unwrapped.elements.some((element) => {
1431
- if (!element || element.type === import_utils20.AST_NODE_TYPES.SpreadElement) {
1522
+ if (!element || element.type === import_utils22.AST_NODE_TYPES.SpreadElement) {
1432
1523
  return false;
1433
1524
  }
1434
1525
  const inner = unwrapAssertion(element);
1435
- return inner?.type === import_utils20.AST_NODE_TYPES.ObjectExpression || inner?.type === import_utils20.AST_NODE_TYPES.ArrayExpression;
1526
+ return inner?.type === import_utils22.AST_NODE_TYPES.ObjectExpression || inner?.type === import_utils22.AST_NODE_TYPES.ArrayExpression;
1436
1527
  });
1437
1528
  }
1438
1529
  return false;
1439
1530
  }
1440
1531
  function hasNestedProperty(object) {
1441
1532
  return object.properties.some((property) => {
1442
- if (property.type !== import_utils20.AST_NODE_TYPES.Property) {
1533
+ if (property.type !== import_utils22.AST_NODE_TYPES.Property) {
1443
1534
  return false;
1444
1535
  }
1445
- if (property.value.type === import_utils20.AST_NODE_TYPES.AssignmentPattern) {
1536
+ if (property.value.type === import_utils22.AST_NODE_TYPES.AssignmentPattern) {
1446
1537
  return false;
1447
1538
  }
1448
1539
  return isNestedValue(property.value);
@@ -1453,12 +1544,12 @@ function getObjectInitializer(init) {
1453
1544
  if (!unwrapped) {
1454
1545
  return null;
1455
1546
  }
1456
- if (unwrapped.type === import_utils20.AST_NODE_TYPES.ObjectExpression) {
1547
+ if (unwrapped.type === import_utils22.AST_NODE_TYPES.ObjectExpression) {
1457
1548
  return unwrapped;
1458
1549
  }
1459
1550
  return null;
1460
1551
  }
1461
- var jsxNoDataObject = createRule15({
1552
+ var jsxNoDataObject = createRule17({
1462
1553
  name: "jsx-no-data-object",
1463
1554
  meta: {
1464
1555
  type: "problem",
@@ -1485,7 +1576,7 @@ var jsxNoDataObject = createRule15({
1485
1576
  if (!hasNestedProperty(objectInit)) {
1486
1577
  return;
1487
1578
  }
1488
- const name = node.id.type === import_utils20.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1579
+ const name = node.id.type === import_utils22.AST_NODE_TYPES.Identifier ? node.id.name : "<destructured>";
1489
1580
  context.report({
1490
1581
  node,
1491
1582
  messageId: "noDataObject",
@@ -1501,11 +1592,11 @@ var jsxNoDataObject = createRule15({
1501
1592
  var jsx_no_data_object_default = jsxNoDataObject;
1502
1593
 
1503
1594
  // src/rules/jsx-no-inline-object-prop.ts
1504
- var import_utils22 = require("@typescript-eslint/utils");
1505
- var createRule16 = import_utils22.ESLintUtils.RuleCreator(
1595
+ var import_utils24 = require("@typescript-eslint/utils");
1596
+ var createRule18 = import_utils24.ESLintUtils.RuleCreator(
1506
1597
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1507
1598
  );
1508
- var jsxNoInlineObjectProp = createRule16({
1599
+ var jsxNoInlineObjectProp = createRule18({
1509
1600
  name: "jsx-no-inline-object-prop",
1510
1601
  meta: {
1511
1602
  type: "suggestion",
@@ -1521,7 +1612,7 @@ var jsxNoInlineObjectProp = createRule16({
1521
1612
  create(context) {
1522
1613
  return {
1523
1614
  JSXAttribute(node) {
1524
- if (node.value?.type === import_utils22.AST_NODE_TYPES.JSXExpressionContainer && node.value.expression.type === import_utils22.AST_NODE_TYPES.ObjectExpression) {
1615
+ if (node.value?.type === import_utils24.AST_NODE_TYPES.JSXExpressionContainer && node.value.expression.type === import_utils24.AST_NODE_TYPES.ObjectExpression) {
1525
1616
  context.report({
1526
1617
  node: node.value,
1527
1618
  messageId: "noInlineObject"
@@ -1534,17 +1625,17 @@ var jsxNoInlineObjectProp = createRule16({
1534
1625
  var jsx_no_inline_object_prop_default = jsxNoInlineObjectProp;
1535
1626
 
1536
1627
  // src/rules/jsx-no-newline-single-line-elements.ts
1537
- var import_utils23 = require("@typescript-eslint/utils");
1538
- var createRule17 = import_utils23.ESLintUtils.RuleCreator(
1628
+ var import_utils25 = require("@typescript-eslint/utils");
1629
+ var createRule19 = import_utils25.ESLintUtils.RuleCreator(
1539
1630
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1540
1631
  );
1541
1632
  function isJSXElementOrFragment(node) {
1542
- return node.type === import_utils23.AST_NODE_TYPES.JSXElement || node.type === import_utils23.AST_NODE_TYPES.JSXFragment;
1633
+ return node.type === import_utils25.AST_NODE_TYPES.JSXElement || node.type === import_utils25.AST_NODE_TYPES.JSXFragment;
1543
1634
  }
1544
1635
  function isSingleLine(node) {
1545
1636
  return node.loc.start.line === node.loc.end.line;
1546
1637
  }
1547
- var jsxNoNewlineSingleLineElements = createRule17({
1638
+ var jsxNoNewlineSingleLineElements = createRule19({
1548
1639
  name: "jsx-no-newline-single-line-elements",
1549
1640
  meta: {
1550
1641
  type: "layout",
@@ -1562,7 +1653,7 @@ var jsxNoNewlineSingleLineElements = createRule17({
1562
1653
  const { sourceCode } = context;
1563
1654
  function checkSiblings(children) {
1564
1655
  const nonWhitespace = children.filter(
1565
- (child) => !(child.type === import_utils23.AST_NODE_TYPES.JSXText && child.value.trim() === "")
1656
+ (child) => !(child.type === import_utils25.AST_NODE_TYPES.JSXText && child.value.trim() === "")
1566
1657
  );
1567
1658
  nonWhitespace.forEach((next, index) => {
1568
1659
  if (index === 0) {
@@ -1613,11 +1704,11 @@ ${indent}`);
1613
1704
  var jsx_no_newline_single_line_elements_default = jsxNoNewlineSingleLineElements;
1614
1705
 
1615
1706
  // src/rules/jsx-no-non-component-function.ts
1616
- var import_utils24 = require("@typescript-eslint/utils");
1617
- var createRule18 = import_utils24.ESLintUtils.RuleCreator(
1707
+ var import_utils26 = require("@typescript-eslint/utils");
1708
+ var createRule20 = import_utils26.ESLintUtils.RuleCreator(
1618
1709
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1619
1710
  );
1620
- var jsxNoNonComponentFunction = createRule18({
1711
+ var jsxNoNonComponentFunction = createRule20({
1621
1712
  name: "jsx-no-non-component-function",
1622
1713
  meta: {
1623
1714
  type: "problem",
@@ -1637,13 +1728,13 @@ var jsxNoNonComponentFunction = createRule18({
1637
1728
  return {};
1638
1729
  }
1639
1730
  function isReactComponent2(node) {
1640
- const functionName = node.type === import_utils24.AST_NODE_TYPES.FunctionDeclaration && node.id ? node.id.name : null;
1731
+ const functionName = node.type === import_utils26.AST_NODE_TYPES.FunctionDeclaration && node.id ? node.id.name : null;
1641
1732
  if (functionName && /^[A-Z]/.test(functionName)) {
1642
1733
  return true;
1643
1734
  }
1644
1735
  if (node.returnType?.typeAnnotation) {
1645
1736
  const returnTypeNode = node.returnType.typeAnnotation;
1646
- if (returnTypeNode.type === import_utils24.AST_NODE_TYPES.TSTypeReference && returnTypeNode.typeName.type === import_utils24.AST_NODE_TYPES.Identifier) {
1737
+ if (returnTypeNode.type === import_utils26.AST_NODE_TYPES.TSTypeReference && returnTypeNode.typeName.type === import_utils26.AST_NODE_TYPES.Identifier) {
1647
1738
  const typeName = returnTypeNode.typeName.name;
1648
1739
  if (typeName === "JSX" || typeName === "ReactElement" || typeName === "ReactNode") {
1649
1740
  return true;
@@ -1660,13 +1751,13 @@ var jsxNoNonComponentFunction = createRule18({
1660
1751
  if (!parent) {
1661
1752
  return;
1662
1753
  }
1663
- if (parent.type === import_utils24.AST_NODE_TYPES.ExportDefaultDeclaration || parent.type === import_utils24.AST_NODE_TYPES.ExportNamedDeclaration) {
1754
+ if (parent.type === import_utils26.AST_NODE_TYPES.ExportDefaultDeclaration || parent.type === import_utils26.AST_NODE_TYPES.ExportNamedDeclaration) {
1664
1755
  return;
1665
1756
  }
1666
- if (declaratorNode?.parent?.parent?.type === import_utils24.AST_NODE_TYPES.ExportNamedDeclaration) {
1757
+ if (declaratorNode?.parent?.parent?.type === import_utils26.AST_NODE_TYPES.ExportNamedDeclaration) {
1667
1758
  return;
1668
1759
  }
1669
- if (declaratorNode?.id.type === import_utils24.AST_NODE_TYPES.Identifier) {
1760
+ if (declaratorNode?.id.type === import_utils26.AST_NODE_TYPES.Identifier) {
1670
1761
  const varName = declaratorNode.id.name;
1671
1762
  if (/^[A-Z]/.test(varName)) {
1672
1763
  return;
@@ -1691,13 +1782,13 @@ var jsxNoNonComponentFunction = createRule18({
1691
1782
  var jsx_no_non_component_function_default = jsxNoNonComponentFunction;
1692
1783
 
1693
1784
  // src/rules/jsx-no-sub-interface.ts
1694
- var import_utils26 = require("@typescript-eslint/utils");
1695
- var createRule19 = import_utils26.ESLintUtils.RuleCreator(
1785
+ var import_utils28 = require("@typescript-eslint/utils");
1786
+ var createRule21 = import_utils28.ESLintUtils.RuleCreator(
1696
1787
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1697
1788
  );
1698
1789
  var PROPS_WRAPPER_NAMES = /* @__PURE__ */ new Set(["Readonly", "Required", "Partial", "PropsWithChildren", "NoInfer"]);
1699
1790
  function unwrapWrapperType(node) {
1700
- if (node.type === import_utils26.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils26.AST_NODE_TYPES.Identifier && PROPS_WRAPPER_NAMES.has(node.typeName.name) && node.typeArguments && node.typeArguments.params.length > 0) {
1791
+ if (node.type === import_utils28.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils28.AST_NODE_TYPES.Identifier && PROPS_WRAPPER_NAMES.has(node.typeName.name) && node.typeArguments && node.typeArguments.params.length > 0) {
1701
1792
  return unwrapWrapperType(node.typeArguments.params[0]);
1702
1793
  }
1703
1794
  return node;
@@ -1707,7 +1798,7 @@ function getMainTypeName(typeNode) {
1707
1798
  return null;
1708
1799
  }
1709
1800
  const unwrapped = unwrapWrapperType(typeNode);
1710
- if (unwrapped.type === import_utils26.AST_NODE_TYPES.TSTypeReference && unwrapped.typeName.type === import_utils26.AST_NODE_TYPES.Identifier) {
1801
+ if (unwrapped.type === import_utils28.AST_NODE_TYPES.TSTypeReference && unwrapped.typeName.type === import_utils28.AST_NODE_TYPES.Identifier) {
1711
1802
  return unwrapped.typeName.name;
1712
1803
  }
1713
1804
  return null;
@@ -1726,15 +1817,15 @@ function isPascalCase2(name) {
1726
1817
  return /^[A-Z]/.test(name);
1727
1818
  }
1728
1819
  function getDeclarationFromExportWrapper(node) {
1729
- if (node.type === import_utils26.AST_NODE_TYPES.ExportNamedDeclaration && node.declaration) {
1820
+ if (node.type === import_utils28.AST_NODE_TYPES.ExportNamedDeclaration && node.declaration) {
1730
1821
  return node.declaration;
1731
1822
  }
1732
- if (node.type === import_utils26.AST_NODE_TYPES.ExportDefaultDeclaration) {
1823
+ if (node.type === import_utils28.AST_NODE_TYPES.ExportDefaultDeclaration) {
1733
1824
  return node.declaration;
1734
1825
  }
1735
1826
  return node;
1736
1827
  }
1737
- var jsxNoSubInterface = createRule19({
1828
+ var jsxNoSubInterface = createRule21({
1738
1829
  name: "jsx-no-sub-interface",
1739
1830
  meta: {
1740
1831
  type: "problem",
@@ -1760,7 +1851,7 @@ var jsxNoSubInterface = createRule19({
1760
1851
  let componentCount = 0;
1761
1852
  for (const statement of programNode.body) {
1762
1853
  const declaration = getDeclarationFromExportWrapper(statement);
1763
- if (declaration.type === import_utils26.AST_NODE_TYPES.FunctionDeclaration && declaration.id && isPascalCase2(declaration.id.name)) {
1854
+ if (declaration.type === import_utils28.AST_NODE_TYPES.FunctionDeclaration && declaration.id && isPascalCase2(declaration.id.name)) {
1764
1855
  componentCount += 1;
1765
1856
  const mainType = getComponentMainTypeName(declaration);
1766
1857
  if (mainType) {
@@ -1768,16 +1859,16 @@ var jsxNoSubInterface = createRule19({
1768
1859
  }
1769
1860
  continue;
1770
1861
  }
1771
- if (declaration.type === import_utils26.AST_NODE_TYPES.VariableDeclaration) {
1862
+ if (declaration.type === import_utils28.AST_NODE_TYPES.VariableDeclaration) {
1772
1863
  for (const declarator of declaration.declarations) {
1773
- if (declarator.id.type !== import_utils26.AST_NODE_TYPES.Identifier) {
1864
+ if (declarator.id.type !== import_utils28.AST_NODE_TYPES.Identifier) {
1774
1865
  continue;
1775
1866
  }
1776
1867
  if (!isPascalCase2(declarator.id.name)) {
1777
1868
  continue;
1778
1869
  }
1779
1870
  const init = declarator.init;
1780
- if (init && (init.type === import_utils26.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils26.AST_NODE_TYPES.FunctionExpression)) {
1871
+ if (init && (init.type === import_utils28.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils28.AST_NODE_TYPES.FunctionExpression)) {
1781
1872
  componentCount += 1;
1782
1873
  const mainType = getComponentMainTypeName(init);
1783
1874
  if (mainType) {
@@ -1787,11 +1878,11 @@ var jsxNoSubInterface = createRule19({
1787
1878
  }
1788
1879
  continue;
1789
1880
  }
1790
- if (declaration.type === import_utils26.AST_NODE_TYPES.TSInterfaceDeclaration) {
1881
+ if (declaration.type === import_utils28.AST_NODE_TYPES.TSInterfaceDeclaration) {
1791
1882
  typeDeclarations.push({ name: declaration.id.name, node: declaration });
1792
1883
  continue;
1793
1884
  }
1794
- if (declaration.type === import_utils26.AST_NODE_TYPES.TSTypeAliasDeclaration) {
1885
+ if (declaration.type === import_utils28.AST_NODE_TYPES.TSTypeAliasDeclaration) {
1795
1886
  typeDeclarations.push({ name: declaration.id.name, node: declaration });
1796
1887
  continue;
1797
1888
  }
@@ -1816,20 +1907,20 @@ var jsxNoSubInterface = createRule19({
1816
1907
  var jsx_no_sub_interface_default = jsxNoSubInterface;
1817
1908
 
1818
1909
  // src/rules/jsx-no-ternary-null.ts
1819
- var import_utils28 = require("@typescript-eslint/utils");
1820
- var createRule20 = import_utils28.ESLintUtils.RuleCreator(
1910
+ var import_utils30 = require("@typescript-eslint/utils");
1911
+ var createRule22 = import_utils30.ESLintUtils.RuleCreator(
1821
1912
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1822
1913
  );
1823
1914
  function isNullOrUndefined(node) {
1824
- if (node.type === import_utils28.AST_NODE_TYPES.Literal && node.value === null) {
1915
+ if (node.type === import_utils30.AST_NODE_TYPES.Literal && node.value === null) {
1825
1916
  return true;
1826
1917
  }
1827
- if (node.type === import_utils28.AST_NODE_TYPES.Identifier && node.name === "undefined") {
1918
+ if (node.type === import_utils30.AST_NODE_TYPES.Identifier && node.name === "undefined") {
1828
1919
  return true;
1829
1920
  }
1830
1921
  return false;
1831
1922
  }
1832
- var jsxNoTernaryNull = createRule20({
1923
+ var jsxNoTernaryNull = createRule22({
1833
1924
  name: "jsx-no-ternary-null",
1834
1925
  meta: {
1835
1926
  type: "suggestion",
@@ -1847,7 +1938,7 @@ var jsxNoTernaryNull = createRule20({
1847
1938
  return {
1848
1939
  JSXExpressionContainer(node) {
1849
1940
  const { expression } = node;
1850
- if (expression.type !== import_utils28.AST_NODE_TYPES.ConditionalExpression) {
1941
+ if (expression.type !== import_utils30.AST_NODE_TYPES.ConditionalExpression) {
1851
1942
  return;
1852
1943
  }
1853
1944
  const { test, consequent, alternate } = expression;
@@ -1879,11 +1970,11 @@ var jsxNoTernaryNull = createRule20({
1879
1970
  var jsx_no_ternary_null_default = jsxNoTernaryNull;
1880
1971
 
1881
1972
  // src/rules/jsx-no-variable-in-callback.ts
1882
- var import_utils29 = require("@typescript-eslint/utils");
1883
- var createRule21 = import_utils29.ESLintUtils.RuleCreator(
1973
+ var import_utils31 = require("@typescript-eslint/utils");
1974
+ var createRule23 = import_utils31.ESLintUtils.RuleCreator(
1884
1975
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1885
1976
  );
1886
- var jsxNoVariableInCallback = createRule21({
1977
+ var jsxNoVariableInCallback = createRule23({
1887
1978
  name: "jsx-no-variable-in-callback",
1888
1979
  meta: {
1889
1980
  type: "suggestion",
@@ -1900,7 +1991,7 @@ var jsxNoVariableInCallback = createRule21({
1900
1991
  function isInsideJSX(node) {
1901
1992
  let current = node.parent;
1902
1993
  while (current) {
1903
- if (current.type === import_utils29.AST_NODE_TYPES.JSXElement || current.type === import_utils29.AST_NODE_TYPES.JSXFragment) {
1994
+ if (current.type === import_utils31.AST_NODE_TYPES.JSXElement || current.type === import_utils31.AST_NODE_TYPES.JSXFragment) {
1904
1995
  return true;
1905
1996
  }
1906
1997
  current = current.parent;
@@ -1914,11 +2005,11 @@ var jsxNoVariableInCallback = createRule21({
1914
2005
  if (!isInsideJSX(node)) {
1915
2006
  return false;
1916
2007
  }
1917
- if (node.parent.type === import_utils29.AST_NODE_TYPES.CallExpression || node.parent.type === import_utils29.AST_NODE_TYPES.JSXExpressionContainer) {
2008
+ if (node.parent.type === import_utils31.AST_NODE_TYPES.CallExpression || node.parent.type === import_utils31.AST_NODE_TYPES.JSXExpressionContainer) {
1918
2009
  return true;
1919
2010
  }
1920
- if (node.parent.type === import_utils29.AST_NODE_TYPES.ArrayExpression && node.parent.parent) {
1921
- if (node.parent.parent.type === import_utils29.AST_NODE_TYPES.CallExpression || node.parent.parent.type === import_utils29.AST_NODE_TYPES.JSXExpressionContainer) {
2011
+ if (node.parent.type === import_utils31.AST_NODE_TYPES.ArrayExpression && node.parent.parent) {
2012
+ if (node.parent.parent.type === import_utils31.AST_NODE_TYPES.CallExpression || node.parent.parent.type === import_utils31.AST_NODE_TYPES.JSXExpressionContainer) {
1922
2013
  return true;
1923
2014
  }
1924
2015
  }
@@ -1929,11 +2020,11 @@ var jsxNoVariableInCallback = createRule21({
1929
2020
  return;
1930
2021
  }
1931
2022
  const { body } = node;
1932
- if (body.type !== import_utils29.AST_NODE_TYPES.BlockStatement) {
2023
+ if (body.type !== import_utils31.AST_NODE_TYPES.BlockStatement) {
1933
2024
  return;
1934
2025
  }
1935
2026
  body.body.forEach((statement) => {
1936
- if (statement.type === import_utils29.AST_NODE_TYPES.VariableDeclaration) {
2027
+ if (statement.type === import_utils31.AST_NODE_TYPES.VariableDeclaration) {
1937
2028
  context.report({
1938
2029
  node: statement,
1939
2030
  messageId: "noVariableInCallback"
@@ -1950,11 +2041,11 @@ var jsxNoVariableInCallback = createRule21({
1950
2041
  var jsx_no_variable_in_callback_default = jsxNoVariableInCallback;
1951
2042
 
1952
2043
  // src/rules/jsx-require-suspense.ts
1953
- var import_utils30 = require("@typescript-eslint/utils");
1954
- var createRule22 = import_utils30.ESLintUtils.RuleCreator(
2044
+ var import_utils32 = require("@typescript-eslint/utils");
2045
+ var createRule24 = import_utils32.ESLintUtils.RuleCreator(
1955
2046
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
1956
2047
  );
1957
- var jsxRequireSuspense = createRule22({
2048
+ var jsxRequireSuspense = createRule24({
1958
2049
  name: "jsx-require-suspense",
1959
2050
  meta: {
1960
2051
  type: "problem",
@@ -1972,7 +2063,7 @@ var jsxRequireSuspense = createRule22({
1972
2063
  const isInsideSuspense = (node) => {
1973
2064
  let current = node.parent;
1974
2065
  while (current) {
1975
- if (current.type === import_utils30.AST_NODE_TYPES.JSXElement && current.openingElement.name.type === import_utils30.AST_NODE_TYPES.JSXIdentifier && current.openingElement.name.name === "Suspense") {
2066
+ if (current.type === import_utils32.AST_NODE_TYPES.JSXElement && current.openingElement.name.type === import_utils32.AST_NODE_TYPES.JSXIdentifier && current.openingElement.name.name === "Suspense") {
1976
2067
  return true;
1977
2068
  }
1978
2069
  current = current.parent;
@@ -1981,16 +2072,16 @@ var jsxRequireSuspense = createRule22({
1981
2072
  };
1982
2073
  return {
1983
2074
  VariableDeclarator(node) {
1984
- if (node.id.type === import_utils30.AST_NODE_TYPES.Identifier && node.init?.type === import_utils30.AST_NODE_TYPES.CallExpression) {
2075
+ if (node.id.type === import_utils32.AST_NODE_TYPES.Identifier && node.init?.type === import_utils32.AST_NODE_TYPES.CallExpression) {
1985
2076
  const { callee } = node.init;
1986
- const isLazyCall = callee.type === import_utils30.AST_NODE_TYPES.Identifier && callee.name === "lazy" || callee.type === import_utils30.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils30.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === import_utils30.AST_NODE_TYPES.Identifier && callee.property.name === "lazy";
2077
+ const isLazyCall = callee.type === import_utils32.AST_NODE_TYPES.Identifier && callee.name === "lazy" || callee.type === import_utils32.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils32.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === import_utils32.AST_NODE_TYPES.Identifier && callee.property.name === "lazy";
1987
2078
  if (isLazyCall) {
1988
2079
  lazyComponents.add(node.id.name);
1989
2080
  }
1990
2081
  }
1991
2082
  },
1992
2083
  JSXOpeningElement(node) {
1993
- if (node.name.type === import_utils30.AST_NODE_TYPES.JSXIdentifier) {
2084
+ if (node.name.type === import_utils32.AST_NODE_TYPES.JSXIdentifier) {
1994
2085
  const componentName = node.name.name;
1995
2086
  if (lazyComponents.has(componentName) && !isInsideSuspense(node)) {
1996
2087
  context.report({
@@ -2009,11 +2100,11 @@ var jsxRequireSuspense = createRule22({
2009
2100
  var jsx_require_suspense_default = jsxRequireSuspense;
2010
2101
 
2011
2102
  // src/rules/jsx-simple-props.ts
2012
- var import_utils31 = require("@typescript-eslint/utils");
2013
- var createRule23 = import_utils31.ESLintUtils.RuleCreator(
2103
+ var import_utils33 = require("@typescript-eslint/utils");
2104
+ var createRule25 = import_utils33.ESLintUtils.RuleCreator(
2014
2105
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2015
2106
  );
2016
- var jsxSimpleProps = createRule23({
2107
+ var jsxSimpleProps = createRule25({
2017
2108
  name: "jsx-simple-props",
2018
2109
  meta: {
2019
2110
  type: "suggestion",
@@ -2028,25 +2119,25 @@ var jsxSimpleProps = createRule23({
2028
2119
  defaultOptions: [],
2029
2120
  create(context) {
2030
2121
  const allowedExpressionTypes = /* @__PURE__ */ new Set([
2031
- import_utils31.AST_NODE_TYPES.Identifier,
2032
- import_utils31.AST_NODE_TYPES.Literal,
2033
- import_utils31.AST_NODE_TYPES.JSXElement,
2034
- import_utils31.AST_NODE_TYPES.JSXFragment,
2035
- import_utils31.AST_NODE_TYPES.MemberExpression,
2036
- import_utils31.AST_NODE_TYPES.ArrowFunctionExpression,
2037
- import_utils31.AST_NODE_TYPES.FunctionExpression
2122
+ import_utils33.AST_NODE_TYPES.Identifier,
2123
+ import_utils33.AST_NODE_TYPES.Literal,
2124
+ import_utils33.AST_NODE_TYPES.JSXElement,
2125
+ import_utils33.AST_NODE_TYPES.JSXFragment,
2126
+ import_utils33.AST_NODE_TYPES.MemberExpression,
2127
+ import_utils33.AST_NODE_TYPES.ArrowFunctionExpression,
2128
+ import_utils33.AST_NODE_TYPES.FunctionExpression
2038
2129
  ]);
2039
2130
  return {
2040
2131
  JSXAttribute(node) {
2041
2132
  if (!node.value) {
2042
2133
  return;
2043
2134
  }
2044
- if (node.value.type === import_utils31.AST_NODE_TYPES.Literal) {
2135
+ if (node.value.type === import_utils33.AST_NODE_TYPES.Literal) {
2045
2136
  return;
2046
2137
  }
2047
- if (node.value.type === import_utils31.AST_NODE_TYPES.JSXExpressionContainer) {
2138
+ if (node.value.type === import_utils33.AST_NODE_TYPES.JSXExpressionContainer) {
2048
2139
  const { expression } = node.value;
2049
- if (expression.type === import_utils31.AST_NODE_TYPES.JSXEmptyExpression) {
2140
+ if (expression.type === import_utils33.AST_NODE_TYPES.JSXEmptyExpression) {
2050
2141
  return;
2051
2142
  }
2052
2143
  if (!allowedExpressionTypes.has(expression.type)) {
@@ -2063,8 +2154,8 @@ var jsxSimpleProps = createRule23({
2063
2154
  var jsx_simple_props_default = jsxSimpleProps;
2064
2155
 
2065
2156
  // src/rules/jsx-sort-props.ts
2066
- var import_utils32 = require("@typescript-eslint/utils");
2067
- var createRule24 = import_utils32.ESLintUtils.RuleCreator(
2157
+ var import_utils34 = require("@typescript-eslint/utils");
2158
+ var createRule26 = import_utils34.ESLintUtils.RuleCreator(
2068
2159
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2069
2160
  );
2070
2161
  var TYPE_GROUP = {
@@ -2078,15 +2169,15 @@ var TYPE_GROUP = {
2078
2169
  SHORTHAND: 8
2079
2170
  };
2080
2171
  var EXPRESSION_TYPE_TO_GROUP = /* @__PURE__ */ new Map([
2081
- [import_utils32.AST_NODE_TYPES.ObjectExpression, TYPE_GROUP.OBJECT_ARRAY],
2082
- [import_utils32.AST_NODE_TYPES.ArrayExpression, TYPE_GROUP.OBJECT_ARRAY],
2083
- [import_utils32.AST_NODE_TYPES.ArrowFunctionExpression, TYPE_GROUP.FUNCTION],
2084
- [import_utils32.AST_NODE_TYPES.FunctionExpression, TYPE_GROUP.FUNCTION],
2085
- [import_utils32.AST_NODE_TYPES.JSXElement, TYPE_GROUP.JSX],
2086
- [import_utils32.AST_NODE_TYPES.JSXFragment, TYPE_GROUP.JSX]
2172
+ [import_utils34.AST_NODE_TYPES.ObjectExpression, TYPE_GROUP.OBJECT_ARRAY],
2173
+ [import_utils34.AST_NODE_TYPES.ArrayExpression, TYPE_GROUP.OBJECT_ARRAY],
2174
+ [import_utils34.AST_NODE_TYPES.ArrowFunctionExpression, TYPE_GROUP.FUNCTION],
2175
+ [import_utils34.AST_NODE_TYPES.FunctionExpression, TYPE_GROUP.FUNCTION],
2176
+ [import_utils34.AST_NODE_TYPES.JSXElement, TYPE_GROUP.JSX],
2177
+ [import_utils34.AST_NODE_TYPES.JSXFragment, TYPE_GROUP.JSX]
2087
2178
  ]);
2088
2179
  function isHyphenatedName(node) {
2089
- return node.name.type === import_utils32.AST_NODE_TYPES.JSXIdentifier && node.name.name.includes("-");
2180
+ return node.name.type === import_utils34.AST_NODE_TYPES.JSXIdentifier && node.name.name.includes("-");
2090
2181
  }
2091
2182
  function getStringGroup(node) {
2092
2183
  return isHyphenatedName(node) ? TYPE_GROUP.HYPHENATED_STRING : TYPE_GROUP.STRING;
@@ -2098,13 +2189,13 @@ function getLiteralValueGroup(value) {
2098
2189
  return TYPE_GROUP.NUMBER_BOOLEAN_NULL;
2099
2190
  }
2100
2191
  function getExpressionGroup(expression) {
2101
- if (expression.type === import_utils32.AST_NODE_TYPES.Literal) {
2192
+ if (expression.type === import_utils34.AST_NODE_TYPES.Literal) {
2102
2193
  return getLiteralValueGroup(expression.value);
2103
2194
  }
2104
- if (expression.type === import_utils32.AST_NODE_TYPES.TemplateLiteral) {
2195
+ if (expression.type === import_utils34.AST_NODE_TYPES.TemplateLiteral) {
2105
2196
  return null;
2106
2197
  }
2107
- if (expression.type === import_utils32.AST_NODE_TYPES.Identifier && expression.name === "undefined") {
2198
+ if (expression.type === import_utils34.AST_NODE_TYPES.Identifier && expression.name === "undefined") {
2108
2199
  return TYPE_GROUP.NUMBER_BOOLEAN_NULL;
2109
2200
  }
2110
2201
  return EXPRESSION_TYPE_TO_GROUP.get(expression.type) ?? TYPE_GROUP.EXPRESSION;
@@ -2113,17 +2204,17 @@ function getTypeGroup(node) {
2113
2204
  if (node.value === null) {
2114
2205
  return TYPE_GROUP.SHORTHAND;
2115
2206
  }
2116
- if (node.value.type === import_utils32.AST_NODE_TYPES.Literal) {
2207
+ if (node.value.type === import_utils34.AST_NODE_TYPES.Literal) {
2117
2208
  if (typeof node.value.value === "string") {
2118
2209
  return getStringGroup(node);
2119
2210
  }
2120
2211
  return TYPE_GROUP.NUMBER_BOOLEAN_NULL;
2121
2212
  }
2122
- if (node.value.type !== import_utils32.AST_NODE_TYPES.JSXExpressionContainer) {
2213
+ if (node.value.type !== import_utils34.AST_NODE_TYPES.JSXExpressionContainer) {
2123
2214
  return null;
2124
2215
  }
2125
2216
  const { expression } = node.value;
2126
- if (expression.type === import_utils32.AST_NODE_TYPES.JSXEmptyExpression) {
2217
+ if (expression.type === import_utils34.AST_NODE_TYPES.JSXEmptyExpression) {
2127
2218
  return null;
2128
2219
  }
2129
2220
  const group = getExpressionGroup(expression);
@@ -2135,7 +2226,7 @@ function getTypeGroup(node) {
2135
2226
  function hasUnsortedProps(attributes) {
2136
2227
  let lastGroup = 0;
2137
2228
  return attributes.some((attribute) => {
2138
- if (attribute.type === import_utils32.AST_NODE_TYPES.JSXSpreadAttribute) {
2229
+ if (attribute.type === import_utils34.AST_NODE_TYPES.JSXSpreadAttribute) {
2139
2230
  lastGroup = 0;
2140
2231
  return false;
2141
2232
  }
@@ -2159,7 +2250,7 @@ function getSegments(attributes) {
2159
2250
  const result = [];
2160
2251
  let current = [];
2161
2252
  attributes.forEach((attr) => {
2162
- if (attr.type === import_utils32.AST_NODE_TYPES.JSXSpreadAttribute) {
2253
+ if (attr.type === import_utils34.AST_NODE_TYPES.JSXSpreadAttribute) {
2163
2254
  if (current.length > 0) {
2164
2255
  result.push(current);
2165
2256
  current = [];
@@ -2173,7 +2264,7 @@ function getSegments(attributes) {
2173
2264
  }
2174
2265
  return result;
2175
2266
  }
2176
- var jsxSortProps = createRule24({
2267
+ var jsxSortProps = createRule26({
2177
2268
  name: "jsx-sort-props",
2178
2269
  meta: {
2179
2270
  type: "suggestion",
@@ -2208,11 +2299,11 @@ var jsxSortProps = createRule24({
2208
2299
  var jsx_sort_props_default = jsxSortProps;
2209
2300
 
2210
2301
  // src/rules/jsx-spread-props-last.ts
2211
- var import_utils33 = require("@typescript-eslint/utils");
2212
- var createRule25 = import_utils33.ESLintUtils.RuleCreator(
2302
+ var import_utils35 = require("@typescript-eslint/utils");
2303
+ var createRule27 = import_utils35.ESLintUtils.RuleCreator(
2213
2304
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2214
2305
  );
2215
- var jsxSpreadPropsLast = createRule25({
2306
+ var jsxSpreadPropsLast = createRule27({
2216
2307
  name: "jsx-spread-props-last",
2217
2308
  meta: {
2218
2309
  type: "suggestion",
@@ -2231,12 +2322,12 @@ var jsxSpreadPropsLast = createRule25({
2231
2322
  const { attributes } = node;
2232
2323
  let lastNonSpreadIndex = -1;
2233
2324
  attributes.forEach((attribute, index) => {
2234
- if (attribute.type !== import_utils33.AST_NODE_TYPES.JSXSpreadAttribute) {
2325
+ if (attribute.type !== import_utils35.AST_NODE_TYPES.JSXSpreadAttribute) {
2235
2326
  lastNonSpreadIndex = index;
2236
2327
  }
2237
2328
  });
2238
2329
  attributes.forEach((attribute, index) => {
2239
- if (attribute.type === import_utils33.AST_NODE_TYPES.JSXSpreadAttribute && index < lastNonSpreadIndex) {
2330
+ if (attribute.type === import_utils35.AST_NODE_TYPES.JSXSpreadAttribute && index < lastNonSpreadIndex) {
2240
2331
  context.report({
2241
2332
  node: attribute,
2242
2333
  messageId: "spreadNotLast"
@@ -2250,12 +2341,12 @@ var jsxSpreadPropsLast = createRule25({
2250
2341
  var jsx_spread_props_last_default = jsxSpreadPropsLast;
2251
2342
 
2252
2343
  // src/rules/newline-after-multiline-block.ts
2253
- var import_utils34 = require("@typescript-eslint/utils");
2254
- var createRule26 = import_utils34.ESLintUtils.RuleCreator(
2344
+ var import_utils36 = require("@typescript-eslint/utils");
2345
+ var createRule28 = import_utils36.ESLintUtils.RuleCreator(
2255
2346
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2256
2347
  );
2257
2348
  function isImportDeclaration(node) {
2258
- return node.type === import_utils34.AST_NODE_TYPES.ImportDeclaration;
2349
+ return node.type === import_utils36.AST_NODE_TYPES.ImportDeclaration;
2259
2350
  }
2260
2351
  function checkStatements(statements, context) {
2261
2352
  const { sourceCode } = context;
@@ -2290,7 +2381,7 @@ function checkStatements(statements, context) {
2290
2381
  }
2291
2382
  });
2292
2383
  }
2293
- var newlineAfterMultilineBlock = createRule26({
2384
+ var newlineAfterMultilineBlock = createRule28({
2294
2385
  name: "newline-after-multiline-block",
2295
2386
  meta: {
2296
2387
  type: "layout",
@@ -2318,11 +2409,11 @@ var newlineAfterMultilineBlock = createRule26({
2318
2409
  var newline_after_multiline_block_default = newlineAfterMultilineBlock;
2319
2410
 
2320
2411
  // src/rules/newline-before-return.ts
2321
- var import_utils35 = require("@typescript-eslint/utils");
2322
- var createRule27 = import_utils35.ESLintUtils.RuleCreator(
2412
+ var import_utils37 = require("@typescript-eslint/utils");
2413
+ var createRule29 = import_utils37.ESLintUtils.RuleCreator(
2323
2414
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2324
2415
  );
2325
- var newlineBeforeReturn = createRule27({
2416
+ var newlineBeforeReturn = createRule29({
2326
2417
  name: "newline-before-return",
2327
2418
  meta: {
2328
2419
  type: "layout",
@@ -2340,7 +2431,7 @@ var newlineBeforeReturn = createRule27({
2340
2431
  const { sourceCode } = context;
2341
2432
  function checkReturnStatement(node) {
2342
2433
  const { parent } = node;
2343
- if (!parent || parent.type !== import_utils35.AST_NODE_TYPES.BlockStatement) {
2434
+ if (!parent || parent.type !== import_utils37.AST_NODE_TYPES.BlockStatement) {
2344
2435
  return;
2345
2436
  }
2346
2437
  const { body: statements } = parent;
@@ -2377,11 +2468,11 @@ var newlineBeforeReturn = createRule27({
2377
2468
  var newline_before_return_default = newlineBeforeReturn;
2378
2469
 
2379
2470
  // src/rules/no-complex-inline-return.ts
2380
- var import_utils36 = require("@typescript-eslint/utils");
2381
- var createRule28 = import_utils36.ESLintUtils.RuleCreator(
2471
+ var import_utils38 = require("@typescript-eslint/utils");
2472
+ var createRule30 = import_utils38.ESLintUtils.RuleCreator(
2382
2473
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2383
2474
  );
2384
- var noComplexInlineReturn = createRule28({
2475
+ var noComplexInlineReturn = createRule30({
2385
2476
  name: "no-complex-inline-return",
2386
2477
  meta: {
2387
2478
  type: "suggestion",
@@ -2397,13 +2488,13 @@ var noComplexInlineReturn = createRule28({
2397
2488
  create(context) {
2398
2489
  const isComplexExpression = (node) => {
2399
2490
  if (!node) return false;
2400
- if (node.type === import_utils36.AST_NODE_TYPES.ConditionalExpression) {
2491
+ if (node.type === import_utils38.AST_NODE_TYPES.ConditionalExpression) {
2401
2492
  return true;
2402
2493
  }
2403
- if (node.type === import_utils36.AST_NODE_TYPES.LogicalExpression) {
2494
+ if (node.type === import_utils38.AST_NODE_TYPES.LogicalExpression) {
2404
2495
  return true;
2405
2496
  }
2406
- if (node.type === import_utils36.AST_NODE_TYPES.NewExpression) {
2497
+ if (node.type === import_utils38.AST_NODE_TYPES.NewExpression) {
2407
2498
  return true;
2408
2499
  }
2409
2500
  return false;
@@ -2423,11 +2514,11 @@ var noComplexInlineReturn = createRule28({
2423
2514
  var no_complex_inline_return_default = noComplexInlineReturn;
2424
2515
 
2425
2516
  // src/rules/no-direct-date.ts
2426
- var import_utils37 = require("@typescript-eslint/utils");
2427
- var createRule29 = import_utils37.ESLintUtils.RuleCreator(
2517
+ var import_utils39 = require("@typescript-eslint/utils");
2518
+ var createRule31 = import_utils39.ESLintUtils.RuleCreator(
2428
2519
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2429
2520
  );
2430
- var noDirectDate = createRule29({
2521
+ var noDirectDate = createRule31({
2431
2522
  name: "no-direct-date",
2432
2523
  meta: {
2433
2524
  type: "problem",
@@ -2445,7 +2536,7 @@ var noDirectDate = createRule29({
2445
2536
  create(context) {
2446
2537
  return {
2447
2538
  NewExpression(node) {
2448
- if (node.callee.type === import_utils37.AST_NODE_TYPES.Identifier && node.callee.name === "Date") {
2539
+ if (node.callee.type === import_utils39.AST_NODE_TYPES.Identifier && node.callee.name === "Date") {
2449
2540
  context.report({
2450
2541
  node,
2451
2542
  messageId: "noNewDate"
@@ -2453,7 +2544,7 @@ var noDirectDate = createRule29({
2453
2544
  }
2454
2545
  },
2455
2546
  CallExpression(node) {
2456
- if (node.callee.type === import_utils37.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils37.AST_NODE_TYPES.Identifier && node.callee.object.name === "Date" && node.callee.property.type === import_utils37.AST_NODE_TYPES.Identifier) {
2547
+ if (node.callee.type === import_utils39.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils39.AST_NODE_TYPES.Identifier && node.callee.object.name === "Date" && node.callee.property.type === import_utils39.AST_NODE_TYPES.Identifier) {
2457
2548
  const methodName = node.callee.property.name;
2458
2549
  if (methodName === "now") {
2459
2550
  context.report({
@@ -2476,11 +2567,11 @@ var no_direct_date_default = noDirectDate;
2476
2567
 
2477
2568
  // src/rules/no-emoji.ts
2478
2569
  var import_emoji_regex = __toESM(require("emoji-regex"), 1);
2479
- var import_utils38 = require("@typescript-eslint/utils");
2480
- var createRule30 = import_utils38.ESLintUtils.RuleCreator(
2570
+ var import_utils40 = require("@typescript-eslint/utils");
2571
+ var createRule32 = import_utils40.ESLintUtils.RuleCreator(
2481
2572
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2482
2573
  );
2483
- var noEmoji = createRule30({
2574
+ var noEmoji = createRule32({
2484
2575
  name: "no-emoji",
2485
2576
  meta: {
2486
2577
  type: "problem",
@@ -2514,11 +2605,11 @@ var noEmoji = createRule30({
2514
2605
  var no_emoji_default = noEmoji;
2515
2606
 
2516
2607
  // src/rules/no-env-fallback.ts
2517
- var import_utils39 = require("@typescript-eslint/utils");
2518
- var createRule31 = import_utils39.ESLintUtils.RuleCreator(
2608
+ var import_utils41 = require("@typescript-eslint/utils");
2609
+ var createRule33 = import_utils41.ESLintUtils.RuleCreator(
2519
2610
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2520
2611
  );
2521
- var noEnvFallback = createRule31({
2612
+ var noEnvFallback = createRule33({
2522
2613
  name: "no-env-fallback",
2523
2614
  meta: {
2524
2615
  type: "problem",
@@ -2533,16 +2624,16 @@ var noEnvFallback = createRule31({
2533
2624
  defaultOptions: [],
2534
2625
  create(context) {
2535
2626
  const isProcessEnvAccess = (node) => {
2536
- if (node.type !== import_utils39.AST_NODE_TYPES.MemberExpression) {
2627
+ if (node.type !== import_utils41.AST_NODE_TYPES.MemberExpression) {
2537
2628
  return false;
2538
2629
  }
2539
2630
  const { object } = node;
2540
- if (object.type !== import_utils39.AST_NODE_TYPES.MemberExpression) {
2631
+ if (object.type !== import_utils41.AST_NODE_TYPES.MemberExpression) {
2541
2632
  return false;
2542
2633
  }
2543
2634
  const processNode = object.object;
2544
2635
  const envNode = object.property;
2545
- return processNode.type === import_utils39.AST_NODE_TYPES.Identifier && processNode.name === "process" && envNode.type === import_utils39.AST_NODE_TYPES.Identifier && envNode.name === "env";
2636
+ return processNode.type === import_utils41.AST_NODE_TYPES.Identifier && processNode.name === "process" && envNode.type === import_utils41.AST_NODE_TYPES.Identifier && envNode.name === "env";
2546
2637
  };
2547
2638
  return {
2548
2639
  LogicalExpression(node) {
@@ -2567,15 +2658,15 @@ var noEnvFallback = createRule31({
2567
2658
  var no_env_fallback_default = noEnvFallback;
2568
2659
 
2569
2660
  // src/rules/no-ghost-wrapper.ts
2570
- var import_utils40 = require("@typescript-eslint/utils");
2571
- var createRule32 = import_utils40.ESLintUtils.RuleCreator(
2661
+ var import_utils42 = require("@typescript-eslint/utils");
2662
+ var createRule34 = import_utils42.ESLintUtils.RuleCreator(
2572
2663
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2573
2664
  );
2574
2665
  var GHOST_TAGS = /* @__PURE__ */ new Set(["div", "span"]);
2575
2666
  function isKeyAttribute(attribute) {
2576
- return attribute.type === import_utils40.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils40.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "key";
2667
+ return attribute.type === import_utils42.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils42.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "key";
2577
2668
  }
2578
- var noGhostWrapper = createRule32({
2669
+ var noGhostWrapper = createRule34({
2579
2670
  name: "no-ghost-wrapper",
2580
2671
  meta: {
2581
2672
  type: "problem",
@@ -2591,7 +2682,7 @@ var noGhostWrapper = createRule32({
2591
2682
  create(context) {
2592
2683
  return {
2593
2684
  JSXOpeningElement(node) {
2594
- if (node.name.type !== import_utils40.AST_NODE_TYPES.JSXIdentifier) {
2685
+ if (node.name.type !== import_utils42.AST_NODE_TYPES.JSXIdentifier) {
2595
2686
  return;
2596
2687
  }
2597
2688
  const tagName = node.name.name;
@@ -2612,12 +2703,92 @@ var noGhostWrapper = createRule32({
2612
2703
  });
2613
2704
  var no_ghost_wrapper_default = noGhostWrapper;
2614
2705
 
2706
+ // src/rules/no-helper-function-in-hook.ts
2707
+ var import_utils43 = require("@typescript-eslint/utils");
2708
+ var createRule35 = import_utils43.ESLintUtils.RuleCreator(
2709
+ (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2710
+ );
2711
+ var noHelperFunctionInHook = createRule35({
2712
+ name: "no-helper-function-in-hook",
2713
+ meta: {
2714
+ type: "suggestion",
2715
+ docs: {
2716
+ description: "Disallow non-hook helper function definitions in hook files"
2717
+ },
2718
+ messages: {
2719
+ noHelperFunction: "Helper functions must not be defined in hook files. Extract to a separate utility file."
2720
+ },
2721
+ schema: []
2722
+ },
2723
+ defaultOptions: [],
2724
+ create(context) {
2725
+ function isAtProgramLevel(node) {
2726
+ const { parent } = node;
2727
+ if (parent === void 0) return false;
2728
+ if (parent.type === import_utils43.AST_NODE_TYPES.Program) return true;
2729
+ if (parent.type !== import_utils43.AST_NODE_TYPES.ExportNamedDeclaration) return false;
2730
+ return parent.parent?.type === import_utils43.AST_NODE_TYPES.Program;
2731
+ }
2732
+ return {
2733
+ FunctionDeclaration(node) {
2734
+ if (!isAtProgramLevel(node)) return;
2735
+ if (node.id !== null && node.id.name.startsWith("use")) return;
2736
+ context.report({ node, messageId: "noHelperFunction" });
2737
+ },
2738
+ VariableDeclarator(node) {
2739
+ if (node.parent.type !== import_utils43.AST_NODE_TYPES.VariableDeclaration) return;
2740
+ if (!isAtProgramLevel(node.parent)) return;
2741
+ if (node.init === null || node.init.type !== import_utils43.AST_NODE_TYPES.ArrowFunctionExpression && node.init.type !== import_utils43.AST_NODE_TYPES.FunctionExpression)
2742
+ return;
2743
+ if (node.id.type === import_utils43.AST_NODE_TYPES.Identifier && node.id.name.startsWith("use")) return;
2744
+ context.report({ node, messageId: "noHelperFunction" });
2745
+ }
2746
+ };
2747
+ }
2748
+ });
2749
+ var no_helper_function_in_hook_default = noHelperFunctionInHook;
2750
+
2751
+ // src/rules/no-helper-function-in-test.ts
2752
+ var import_utils44 = require("@typescript-eslint/utils");
2753
+ var createRule36 = import_utils44.ESLintUtils.RuleCreator(
2754
+ (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2755
+ );
2756
+ var noHelperFunctionInTest = createRule36({
2757
+ name: "no-helper-function-in-test",
2758
+ meta: {
2759
+ type: "suggestion",
2760
+ docs: {
2761
+ description: "Disallow helper function definitions in test files"
2762
+ },
2763
+ messages: {
2764
+ noHelperFunction: "Helper functions must not be defined in test files. Extract to a separate utility file."
2765
+ },
2766
+ schema: []
2767
+ },
2768
+ defaultOptions: [],
2769
+ create(context) {
2770
+ return {
2771
+ FunctionDeclaration(node) {
2772
+ if (node.parent.type === import_utils44.AST_NODE_TYPES.Program) {
2773
+ context.report({ node, messageId: "noHelperFunction" });
2774
+ }
2775
+ },
2776
+ VariableDeclarator(node) {
2777
+ if (node.parent.type === import_utils44.AST_NODE_TYPES.VariableDeclaration && node.parent.parent.type === import_utils44.AST_NODE_TYPES.Program && node.init !== null && (node.init.type === import_utils44.AST_NODE_TYPES.ArrowFunctionExpression || node.init.type === import_utils44.AST_NODE_TYPES.FunctionExpression)) {
2778
+ context.report({ node, messageId: "noHelperFunction" });
2779
+ }
2780
+ }
2781
+ };
2782
+ }
2783
+ });
2784
+ var no_helper_function_in_test_default = noHelperFunctionInTest;
2785
+
2615
2786
  // src/rules/no-inline-default-export.ts
2616
- var import_utils41 = require("@typescript-eslint/utils");
2617
- var createRule33 = import_utils41.ESLintUtils.RuleCreator(
2787
+ var import_utils45 = require("@typescript-eslint/utils");
2788
+ var createRule37 = import_utils45.ESLintUtils.RuleCreator(
2618
2789
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2619
2790
  );
2620
- var noInlineDefaultExport = createRule33({
2791
+ var noInlineDefaultExport = createRule37({
2621
2792
  name: "no-inline-default-export",
2622
2793
  meta: {
2623
2794
  type: "suggestion",
@@ -2636,7 +2807,7 @@ var noInlineDefaultExport = createRule33({
2636
2807
  return {
2637
2808
  ExportDefaultDeclaration(node) {
2638
2809
  const { declaration } = node;
2639
- if (declaration.type === import_utils41.AST_NODE_TYPES.FunctionDeclaration) {
2810
+ if (declaration.type === import_utils45.AST_NODE_TYPES.FunctionDeclaration) {
2640
2811
  if (declaration.id) {
2641
2812
  context.report({
2642
2813
  node,
@@ -2651,7 +2822,7 @@ var noInlineDefaultExport = createRule33({
2651
2822
  });
2652
2823
  }
2653
2824
  }
2654
- if (declaration.type === import_utils41.AST_NODE_TYPES.ClassDeclaration) {
2825
+ if (declaration.type === import_utils45.AST_NODE_TYPES.ClassDeclaration) {
2655
2826
  if (declaration.id) {
2656
2827
  context.report({
2657
2828
  node,
@@ -2666,7 +2837,7 @@ var noInlineDefaultExport = createRule33({
2666
2837
  });
2667
2838
  }
2668
2839
  }
2669
- if (declaration.type === import_utils41.AST_NODE_TYPES.ArrowFunctionExpression || declaration.type === import_utils41.AST_NODE_TYPES.FunctionExpression) {
2840
+ if (declaration.type === import_utils45.AST_NODE_TYPES.ArrowFunctionExpression || declaration.type === import_utils45.AST_NODE_TYPES.FunctionExpression) {
2670
2841
  context.report({
2671
2842
  node,
2672
2843
  messageId: "noAnonymousDefaultExport",
@@ -2679,14 +2850,14 @@ var noInlineDefaultExport = createRule33({
2679
2850
  if (!declaration) {
2680
2851
  return;
2681
2852
  }
2682
- if (declaration.type === import_utils41.AST_NODE_TYPES.FunctionDeclaration && declaration.id) {
2853
+ if (declaration.type === import_utils45.AST_NODE_TYPES.FunctionDeclaration && declaration.id) {
2683
2854
  context.report({
2684
2855
  node,
2685
2856
  messageId: "noInlineNamedExport",
2686
2857
  data: { type: "function", name: declaration.id.name }
2687
2858
  });
2688
2859
  }
2689
- if (declaration.type === import_utils41.AST_NODE_TYPES.ClassDeclaration && declaration.id) {
2860
+ if (declaration.type === import_utils45.AST_NODE_TYPES.ClassDeclaration && declaration.id) {
2690
2861
  context.report({
2691
2862
  node,
2692
2863
  messageId: "noInlineNamedExport",
@@ -2700,27 +2871,27 @@ var noInlineDefaultExport = createRule33({
2700
2871
  var no_inline_default_export_default = noInlineDefaultExport;
2701
2872
 
2702
2873
  // src/rules/no-inline-nested-object.ts
2703
- var import_utils42 = require("@typescript-eslint/utils");
2704
- var createRule34 = import_utils42.ESLintUtils.RuleCreator(
2874
+ var import_utils46 = require("@typescript-eslint/utils");
2875
+ var createRule38 = import_utils46.ESLintUtils.RuleCreator(
2705
2876
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2706
2877
  );
2707
2878
  function isObjectOrArray(node) {
2708
- return node.type === import_utils42.AST_NODE_TYPES.ObjectExpression || node.type === import_utils42.AST_NODE_TYPES.ArrayExpression || node.type === import_utils42.AST_NODE_TYPES.TSAsExpression;
2879
+ return node.type === import_utils46.AST_NODE_TYPES.ObjectExpression || node.type === import_utils46.AST_NODE_TYPES.ArrayExpression || node.type === import_utils46.AST_NODE_TYPES.TSAsExpression;
2709
2880
  }
2710
2881
  function getInnerExpression(node) {
2711
- if (node.type === import_utils42.AST_NODE_TYPES.TSAsExpression) {
2882
+ if (node.type === import_utils46.AST_NODE_TYPES.TSAsExpression) {
2712
2883
  return getInnerExpression(node.expression);
2713
2884
  }
2714
2885
  return node;
2715
2886
  }
2716
2887
  function isNestedStructure(node) {
2717
2888
  const inner = getInnerExpression(node);
2718
- return inner.type === import_utils42.AST_NODE_TYPES.ObjectExpression || inner.type === import_utils42.AST_NODE_TYPES.ArrayExpression;
2889
+ return inner.type === import_utils46.AST_NODE_TYPES.ObjectExpression || inner.type === import_utils46.AST_NODE_TYPES.ArrayExpression;
2719
2890
  }
2720
2891
  function containsNestedStructure(node) {
2721
- if (node.type === import_utils42.AST_NODE_TYPES.ObjectExpression) {
2892
+ if (node.type === import_utils46.AST_NODE_TYPES.ObjectExpression) {
2722
2893
  return node.properties.some((prop) => {
2723
- if (prop.type !== import_utils42.AST_NODE_TYPES.Property) return false;
2894
+ if (prop.type !== import_utils46.AST_NODE_TYPES.Property) return false;
2724
2895
  return isNestedStructure(prop.value);
2725
2896
  });
2726
2897
  }
@@ -2729,7 +2900,7 @@ function containsNestedStructure(node) {
2729
2900
  return isNestedStructure(el);
2730
2901
  });
2731
2902
  }
2732
- var noInlineNestedObject = createRule34({
2903
+ var noInlineNestedObject = createRule38({
2733
2904
  name: "no-inline-nested-object",
2734
2905
  meta: {
2735
2906
  type: "layout",
@@ -2751,7 +2922,7 @@ var noInlineNestedObject = createRule34({
2751
2922
  return;
2752
2923
  }
2753
2924
  const valueNode = getInnerExpression(node.value);
2754
- if (valueNode.type !== import_utils42.AST_NODE_TYPES.ObjectExpression && valueNode.type !== import_utils42.AST_NODE_TYPES.ArrayExpression) {
2925
+ if (valueNode.type !== import_utils46.AST_NODE_TYPES.ObjectExpression && valueNode.type !== import_utils46.AST_NODE_TYPES.ArrayExpression) {
2755
2926
  return;
2756
2927
  }
2757
2928
  if (!valueNode.loc) {
@@ -2764,7 +2935,7 @@ var noInlineNestedObject = createRule34({
2764
2935
  if (!containsNestedStructure(valueNode)) {
2765
2936
  return;
2766
2937
  }
2767
- const elements = valueNode.type === import_utils42.AST_NODE_TYPES.ObjectExpression ? valueNode.properties : valueNode.elements;
2938
+ const elements = valueNode.type === import_utils46.AST_NODE_TYPES.ObjectExpression ? valueNode.properties : valueNode.elements;
2768
2939
  context.report({
2769
2940
  node: valueNode,
2770
2941
  messageId: "requireMultiline",
@@ -2777,7 +2948,7 @@ var noInlineNestedObject = createRule34({
2777
2948
  const indent = " ".repeat(node.loc?.start.column ?? 0);
2778
2949
  const innerIndent = `${indent} `;
2779
2950
  const elementTexts = elements.filter((el) => el !== null).map((el) => sourceCode.getText(el));
2780
- const isObject = valueNode.type === import_utils42.AST_NODE_TYPES.ObjectExpression;
2951
+ const isObject = valueNode.type === import_utils46.AST_NODE_TYPES.ObjectExpression;
2781
2952
  const openChar = isObject ? "{" : "[";
2782
2953
  const closeChar = isObject ? "}" : "]";
2783
2954
  const formattedElements = elementTexts.map((text) => `${innerIndent}${text},`).join("\n");
@@ -2794,20 +2965,20 @@ ${indent}${closeChar}`;
2794
2965
  var no_inline_nested_object_default = noInlineNestedObject;
2795
2966
 
2796
2967
  // src/rules/no-inline-return-properties.ts
2797
- var import_utils43 = require("@typescript-eslint/utils");
2798
- var createRule35 = import_utils43.ESLintUtils.RuleCreator(
2968
+ var import_utils47 = require("@typescript-eslint/utils");
2969
+ var createRule39 = import_utils47.ESLintUtils.RuleCreator(
2799
2970
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2800
2971
  );
2801
2972
  var isShorthandProperty = (property) => {
2802
- if (property.type === import_utils43.AST_NODE_TYPES.SpreadElement) {
2973
+ if (property.type === import_utils47.AST_NODE_TYPES.SpreadElement) {
2803
2974
  return true;
2804
2975
  }
2805
- if (property.type !== import_utils43.AST_NODE_TYPES.Property) {
2976
+ if (property.type !== import_utils47.AST_NODE_TYPES.Property) {
2806
2977
  return false;
2807
2978
  }
2808
2979
  return property.shorthand;
2809
2980
  };
2810
- var noInlineReturnProperties = createRule35({
2981
+ var noInlineReturnProperties = createRule39({
2811
2982
  name: "no-inline-return-properties",
2812
2983
  meta: {
2813
2984
  type: "suggestion",
@@ -2823,20 +2994,20 @@ var noInlineReturnProperties = createRule35({
2823
2994
  create(context) {
2824
2995
  return {
2825
2996
  ReturnStatement(node) {
2826
- if (!node.argument || node.argument.type !== import_utils43.AST_NODE_TYPES.ObjectExpression) {
2997
+ if (!node.argument || node.argument.type !== import_utils47.AST_NODE_TYPES.ObjectExpression) {
2827
2998
  return;
2828
2999
  }
2829
3000
  node.argument.properties.forEach((property) => {
2830
3001
  if (isShorthandProperty(property)) {
2831
3002
  return;
2832
3003
  }
2833
- if (property.type !== import_utils43.AST_NODE_TYPES.Property) {
3004
+ if (property.type !== import_utils47.AST_NODE_TYPES.Property) {
2834
3005
  return;
2835
3006
  }
2836
3007
  let keyName = null;
2837
- if (property.key.type === import_utils43.AST_NODE_TYPES.Identifier) {
3008
+ if (property.key.type === import_utils47.AST_NODE_TYPES.Identifier) {
2838
3009
  keyName = property.key.name;
2839
- } else if (property.key.type === import_utils43.AST_NODE_TYPES.Literal) {
3010
+ } else if (property.key.type === import_utils47.AST_NODE_TYPES.Literal) {
2840
3011
  keyName = String(property.key.value);
2841
3012
  }
2842
3013
  context.report({
@@ -2852,12 +3023,12 @@ var noInlineReturnProperties = createRule35({
2852
3023
  var no_inline_return_properties_default = noInlineReturnProperties;
2853
3024
 
2854
3025
  // src/rules/no-inline-type-import.ts
2855
- var import_utils44 = require("@typescript-eslint/utils");
2856
- var createRule36 = import_utils44.ESLintUtils.RuleCreator(
3026
+ var import_utils48 = require("@typescript-eslint/utils");
3027
+ var createRule40 = import_utils48.ESLintUtils.RuleCreator(
2857
3028
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2858
3029
  );
2859
- var isInlineTypeSpecifier = (specifier) => specifier.type === import_utils44.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type";
2860
- var noInlineTypeImport = createRule36({
3030
+ var isInlineTypeSpecifier = (specifier) => specifier.type === import_utils48.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type";
3031
+ var noInlineTypeImport = createRule40({
2861
3032
  name: "no-inline-type-import",
2862
3033
  meta: {
2863
3034
  type: "suggestion",
@@ -2894,7 +3065,7 @@ var noInlineTypeImport = createRule36({
2894
3065
  );
2895
3066
  const typeImport = `import type { ${typeSpecifierTexts.join(", ")} } from ${sourceText};`;
2896
3067
  const valueSpecifiers = node.specifiers.filter(
2897
- (specifier) => !(specifier.type === import_utils44.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type")
3068
+ (specifier) => !(specifier.type === import_utils48.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type")
2898
3069
  );
2899
3070
  if (valueSpecifiers.length === 0) {
2900
3071
  return fixer.replaceText(node, typeImport);
@@ -2902,11 +3073,11 @@ var noInlineTypeImport = createRule36({
2902
3073
  const parts = [];
2903
3074
  const namedValueSpecifiers = [];
2904
3075
  for (const specifier of valueSpecifiers) {
2905
- if (specifier.type === import_utils44.AST_NODE_TYPES.ImportDefaultSpecifier) {
3076
+ if (specifier.type === import_utils48.AST_NODE_TYPES.ImportDefaultSpecifier) {
2906
3077
  parts.push(specifier.local.name);
2907
- } else if (specifier.type === import_utils44.AST_NODE_TYPES.ImportNamespaceSpecifier) {
3078
+ } else if (specifier.type === import_utils48.AST_NODE_TYPES.ImportNamespaceSpecifier) {
2908
3079
  parts.push(`* as ${specifier.local.name}`);
2909
- } else if (specifier.type === import_utils44.AST_NODE_TYPES.ImportSpecifier) {
3080
+ } else if (specifier.type === import_utils48.AST_NODE_TYPES.ImportSpecifier) {
2910
3081
  namedValueSpecifiers.push(specifier);
2911
3082
  }
2912
3083
  }
@@ -2926,8 +3097,8 @@ ${typeImport}`);
2926
3097
  var no_inline_type_import_default = noInlineTypeImport;
2927
3098
 
2928
3099
  // src/rules/no-lazy-identifiers.ts
2929
- var import_utils45 = require("@typescript-eslint/utils");
2930
- var createRule37 = import_utils45.ESLintUtils.RuleCreator(
3100
+ var import_utils49 = require("@typescript-eslint/utils");
3101
+ var createRule41 = import_utils49.ESLintUtils.RuleCreator(
2931
3102
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
2932
3103
  );
2933
3104
  var KEYBOARD_ROWS = ["qwertyuiop", "asdfghjkl", "zxcvbnm", "1234567890"];
@@ -2968,7 +3139,7 @@ var isLazyIdentifier = (name) => {
2968
3139
  }
2969
3140
  return false;
2970
3141
  };
2971
- var noLazyIdentifiers = createRule37({
3142
+ var noLazyIdentifiers = createRule41({
2972
3143
  name: "no-lazy-identifiers",
2973
3144
  meta: {
2974
3145
  type: "problem",
@@ -2994,27 +3165,27 @@ var noLazyIdentifiers = createRule37({
2994
3165
  });
2995
3166
  };
2996
3167
  const checkPattern = (pattern) => {
2997
- if (pattern.type === import_utils45.AST_NODE_TYPES.Identifier) {
3168
+ if (pattern.type === import_utils49.AST_NODE_TYPES.Identifier) {
2998
3169
  checkIdentifier(pattern);
2999
- } else if (pattern.type === import_utils45.AST_NODE_TYPES.ObjectPattern) {
3170
+ } else if (pattern.type === import_utils49.AST_NODE_TYPES.ObjectPattern) {
3000
3171
  pattern.properties.forEach((prop) => {
3001
- if (prop.type === import_utils45.AST_NODE_TYPES.Property && prop.value.type === import_utils45.AST_NODE_TYPES.Identifier) {
3172
+ if (prop.type === import_utils49.AST_NODE_TYPES.Property && prop.value.type === import_utils49.AST_NODE_TYPES.Identifier) {
3002
3173
  checkIdentifier(prop.value);
3003
- } else if (prop.type === import_utils45.AST_NODE_TYPES.RestElement && prop.argument.type === import_utils45.AST_NODE_TYPES.Identifier) {
3174
+ } else if (prop.type === import_utils49.AST_NODE_TYPES.RestElement && prop.argument.type === import_utils49.AST_NODE_TYPES.Identifier) {
3004
3175
  checkIdentifier(prop.argument);
3005
3176
  }
3006
3177
  });
3007
- } else if (pattern.type === import_utils45.AST_NODE_TYPES.ArrayPattern) {
3178
+ } else if (pattern.type === import_utils49.AST_NODE_TYPES.ArrayPattern) {
3008
3179
  pattern.elements.forEach((element) => {
3009
- if (element?.type === import_utils45.AST_NODE_TYPES.Identifier) {
3180
+ if (element?.type === import_utils49.AST_NODE_TYPES.Identifier) {
3010
3181
  checkIdentifier(element);
3011
- } else if (element?.type === import_utils45.AST_NODE_TYPES.RestElement && element.argument.type === import_utils45.AST_NODE_TYPES.Identifier) {
3182
+ } else if (element?.type === import_utils49.AST_NODE_TYPES.RestElement && element.argument.type === import_utils49.AST_NODE_TYPES.Identifier) {
3012
3183
  checkIdentifier(element.argument);
3013
3184
  }
3014
3185
  });
3015
- } else if (pattern.type === import_utils45.AST_NODE_TYPES.AssignmentPattern && pattern.left.type === import_utils45.AST_NODE_TYPES.Identifier) {
3186
+ } else if (pattern.type === import_utils49.AST_NODE_TYPES.AssignmentPattern && pattern.left.type === import_utils49.AST_NODE_TYPES.Identifier) {
3016
3187
  checkIdentifier(pattern.left);
3017
- } else if (pattern.type === import_utils45.AST_NODE_TYPES.RestElement && pattern.argument.type === import_utils45.AST_NODE_TYPES.Identifier) {
3188
+ } else if (pattern.type === import_utils49.AST_NODE_TYPES.RestElement && pattern.argument.type === import_utils49.AST_NODE_TYPES.Identifier) {
3018
3189
  checkIdentifier(pattern.argument);
3019
3190
  }
3020
3191
  };
@@ -3059,11 +3230,11 @@ var noLazyIdentifiers = createRule37({
3059
3230
  var no_lazy_identifiers_default = noLazyIdentifiers;
3060
3231
 
3061
3232
  // src/rules/no-logic-in-params.ts
3062
- var import_utils46 = require("@typescript-eslint/utils");
3063
- var createRule38 = import_utils46.ESLintUtils.RuleCreator(
3233
+ var import_utils50 = require("@typescript-eslint/utils");
3234
+ var createRule42 = import_utils50.ESLintUtils.RuleCreator(
3064
3235
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3065
3236
  );
3066
- var noLogicInParams = createRule38({
3237
+ var noLogicInParams = createRule42({
3067
3238
  name: "no-logic-in-params",
3068
3239
  meta: {
3069
3240
  type: "suggestion",
@@ -3078,20 +3249,20 @@ var noLogicInParams = createRule38({
3078
3249
  defaultOptions: [],
3079
3250
  create(context) {
3080
3251
  const isComplexExpression = (node) => {
3081
- if (node.type === import_utils46.AST_NODE_TYPES.SpreadElement) {
3252
+ if (node.type === import_utils50.AST_NODE_TYPES.SpreadElement) {
3082
3253
  return false;
3083
3254
  }
3084
- if (node.type === import_utils46.AST_NODE_TYPES.ConditionalExpression) {
3255
+ if (node.type === import_utils50.AST_NODE_TYPES.ConditionalExpression) {
3085
3256
  return true;
3086
3257
  }
3087
- if (node.type === import_utils46.AST_NODE_TYPES.LogicalExpression) {
3258
+ if (node.type === import_utils50.AST_NODE_TYPES.LogicalExpression) {
3088
3259
  return true;
3089
3260
  }
3090
- if (node.type === import_utils46.AST_NODE_TYPES.BinaryExpression) {
3261
+ if (node.type === import_utils50.AST_NODE_TYPES.BinaryExpression) {
3091
3262
  const logicalOperators = ["==", "===", "!=", "!==", "<", ">", "<=", ">=", "in", "instanceof"];
3092
3263
  return logicalOperators.includes(node.operator);
3093
3264
  }
3094
- if (node.type === import_utils46.AST_NODE_TYPES.UnaryExpression) {
3265
+ if (node.type === import_utils50.AST_NODE_TYPES.UnaryExpression) {
3095
3266
  return node.operator === "!";
3096
3267
  }
3097
3268
  return false;
@@ -3104,7 +3275,7 @@ var noLogicInParams = createRule38({
3104
3275
  messageId: "noLogicInParams"
3105
3276
  });
3106
3277
  }
3107
- if (arg.type === import_utils46.AST_NODE_TYPES.ArrayExpression) {
3278
+ if (arg.type === import_utils50.AST_NODE_TYPES.ArrayExpression) {
3108
3279
  arg.elements.forEach((element) => {
3109
3280
  if (element && isComplexExpression(element)) {
3110
3281
  context.report({
@@ -3129,46 +3300,46 @@ var noLogicInParams = createRule38({
3129
3300
  var no_logic_in_params_default = noLogicInParams;
3130
3301
 
3131
3302
  // src/rules/no-misleading-constant-case.ts
3132
- var import_utils47 = require("@typescript-eslint/utils");
3133
- var createRule39 = import_utils47.ESLintUtils.RuleCreator(
3303
+ var import_utils51 = require("@typescript-eslint/utils");
3304
+ var createRule43 = import_utils51.ESLintUtils.RuleCreator(
3134
3305
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3135
3306
  );
3136
3307
  var SCREAMING_SNAKE_CASE_REGEX3 = /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$/;
3137
- var isAsConstAssertion = (node) => node.type === import_utils47.AST_NODE_TYPES.TSAsExpression && node.typeAnnotation.type === import_utils47.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeName.type === import_utils47.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeName.name === "const";
3308
+ var isAsConstAssertion = (node) => node.type === import_utils51.AST_NODE_TYPES.TSAsExpression && node.typeAnnotation.type === import_utils51.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeName.type === import_utils51.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeName.name === "const";
3138
3309
  var isStaticValue2 = (init) => {
3139
3310
  if (isAsConstAssertion(init)) {
3140
3311
  return true;
3141
3312
  }
3142
- if (init.type === import_utils47.AST_NODE_TYPES.Literal) {
3313
+ if (init.type === import_utils51.AST_NODE_TYPES.Literal) {
3143
3314
  return true;
3144
3315
  }
3145
- if (init.type === import_utils47.AST_NODE_TYPES.UnaryExpression && init.argument.type === import_utils47.AST_NODE_TYPES.Literal) {
3316
+ if (init.type === import_utils51.AST_NODE_TYPES.UnaryExpression && init.argument.type === import_utils51.AST_NODE_TYPES.Literal) {
3146
3317
  return true;
3147
3318
  }
3148
- if (init.type === import_utils47.AST_NODE_TYPES.TemplateLiteral && init.expressions.length === 0) {
3319
+ if (init.type === import_utils51.AST_NODE_TYPES.TemplateLiteral && init.expressions.length === 0) {
3149
3320
  return true;
3150
3321
  }
3151
- if (init.type === import_utils47.AST_NODE_TYPES.ArrayExpression) {
3152
- return init.elements.every((el) => el !== null && el.type !== import_utils47.AST_NODE_TYPES.SpreadElement && isStaticValue2(el));
3322
+ if (init.type === import_utils51.AST_NODE_TYPES.ArrayExpression) {
3323
+ return init.elements.every((el) => el !== null && el.type !== import_utils51.AST_NODE_TYPES.SpreadElement && isStaticValue2(el));
3153
3324
  }
3154
- if (init.type === import_utils47.AST_NODE_TYPES.ObjectExpression) {
3325
+ if (init.type === import_utils51.AST_NODE_TYPES.ObjectExpression) {
3155
3326
  return init.properties.every(
3156
- (prop) => prop.type === import_utils47.AST_NODE_TYPES.Property && isStaticValue2(prop.value)
3327
+ (prop) => prop.type === import_utils51.AST_NODE_TYPES.Property && isStaticValue2(prop.value)
3157
3328
  );
3158
3329
  }
3159
3330
  return false;
3160
3331
  };
3161
3332
  var isGlobalScope3 = (node) => {
3162
3333
  const { parent } = node;
3163
- if (parent.type === import_utils47.AST_NODE_TYPES.Program) {
3334
+ if (parent.type === import_utils51.AST_NODE_TYPES.Program) {
3164
3335
  return true;
3165
3336
  }
3166
- if (parent.type === import_utils47.AST_NODE_TYPES.ExportNamedDeclaration && parent.parent?.type === import_utils47.AST_NODE_TYPES.Program) {
3337
+ if (parent.type === import_utils51.AST_NODE_TYPES.ExportNamedDeclaration && parent.parent?.type === import_utils51.AST_NODE_TYPES.Program) {
3167
3338
  return true;
3168
3339
  }
3169
3340
  return false;
3170
3341
  };
3171
- var noMisleadingConstantCase = createRule39({
3342
+ var noMisleadingConstantCase = createRule43({
3172
3343
  name: "no-misleading-constant-case",
3173
3344
  meta: {
3174
3345
  type: "suggestion",
@@ -3187,7 +3358,7 @@ var noMisleadingConstantCase = createRule39({
3187
3358
  return {
3188
3359
  VariableDeclaration(node) {
3189
3360
  node.declarations.forEach((declarator) => {
3190
- if (declarator.id.type !== import_utils47.AST_NODE_TYPES.Identifier) {
3361
+ if (declarator.id.type !== import_utils51.AST_NODE_TYPES.Identifier) {
3191
3362
  return;
3192
3363
  }
3193
3364
  const { name } = declarator.id;
@@ -3228,11 +3399,11 @@ var noMisleadingConstantCase = createRule39({
3228
3399
  var no_misleading_constant_case_default = noMisleadingConstantCase;
3229
3400
 
3230
3401
  // src/rules/no-nested-interface-declaration.ts
3231
- var import_utils48 = require("@typescript-eslint/utils");
3232
- var createRule40 = import_utils48.ESLintUtils.RuleCreator(
3402
+ var import_utils52 = require("@typescript-eslint/utils");
3403
+ var createRule44 = import_utils52.ESLintUtils.RuleCreator(
3233
3404
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3234
3405
  );
3235
- var noNestedInterfaceDeclaration = createRule40({
3406
+ var noNestedInterfaceDeclaration = createRule44({
3236
3407
  name: "no-nested-interface-declaration",
3237
3408
  meta: {
3238
3409
  type: "suggestion",
@@ -3253,15 +3424,15 @@ var noNestedInterfaceDeclaration = createRule40({
3253
3424
  return;
3254
3425
  }
3255
3426
  const { typeAnnotation } = node.typeAnnotation;
3256
- if (typeAnnotation.type === import_utils48.AST_NODE_TYPES.TSTypeLiteral) {
3427
+ if (typeAnnotation.type === import_utils52.AST_NODE_TYPES.TSTypeLiteral) {
3257
3428
  context.report({
3258
3429
  node: typeAnnotation,
3259
3430
  messageId: "noNestedInterface"
3260
3431
  });
3261
3432
  return;
3262
3433
  }
3263
- if (typeAnnotation.type === import_utils48.AST_NODE_TYPES.TSArrayType) {
3264
- if (typeAnnotation.elementType.type === import_utils48.AST_NODE_TYPES.TSTypeLiteral) {
3434
+ if (typeAnnotation.type === import_utils52.AST_NODE_TYPES.TSArrayType) {
3435
+ if (typeAnnotation.elementType.type === import_utils52.AST_NODE_TYPES.TSTypeLiteral) {
3265
3436
  context.report({
3266
3437
  node: typeAnnotation.elementType,
3267
3438
  messageId: "noNestedInterface"
@@ -3269,9 +3440,9 @@ var noNestedInterfaceDeclaration = createRule40({
3269
3440
  }
3270
3441
  return;
3271
3442
  }
3272
- if (typeAnnotation.type === import_utils48.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeArguments) {
3443
+ if (typeAnnotation.type === import_utils52.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeArguments) {
3273
3444
  typeAnnotation.typeArguments.params.forEach((param) => {
3274
- if (param.type === import_utils48.AST_NODE_TYPES.TSTypeLiteral) {
3445
+ if (param.type === import_utils52.AST_NODE_TYPES.TSTypeLiteral) {
3275
3446
  context.report({
3276
3447
  node: param,
3277
3448
  messageId: "noNestedInterface"
@@ -3286,11 +3457,11 @@ var noNestedInterfaceDeclaration = createRule40({
3286
3457
  var no_nested_interface_declaration_default = noNestedInterfaceDeclaration;
3287
3458
 
3288
3459
  // src/rules/no-nested-ternary.ts
3289
- var import_utils49 = require("@typescript-eslint/utils");
3290
- var createRule41 = import_utils49.ESLintUtils.RuleCreator(
3460
+ var import_utils53 = require("@typescript-eslint/utils");
3461
+ var createRule45 = import_utils53.ESLintUtils.RuleCreator(
3291
3462
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3292
3463
  );
3293
- var noNestedTernary = createRule41({
3464
+ var noNestedTernary = createRule45({
3294
3465
  name: "no-nested-ternary",
3295
3466
  meta: {
3296
3467
  type: "suggestion",
@@ -3307,13 +3478,13 @@ var noNestedTernary = createRule41({
3307
3478
  return {
3308
3479
  ConditionalExpression(node) {
3309
3480
  const { consequent, alternate } = node;
3310
- if (consequent.type === import_utils49.AST_NODE_TYPES.ConditionalExpression) {
3481
+ if (consequent.type === import_utils53.AST_NODE_TYPES.ConditionalExpression) {
3311
3482
  context.report({
3312
3483
  node: consequent,
3313
3484
  messageId: "noNestedTernary"
3314
3485
  });
3315
3486
  }
3316
- if (alternate.type === import_utils49.AST_NODE_TYPES.ConditionalExpression) {
3487
+ if (alternate.type === import_utils53.AST_NODE_TYPES.ConditionalExpression) {
3317
3488
  context.report({
3318
3489
  node: alternate,
3319
3490
  messageId: "noNestedTernary"
@@ -3326,33 +3497,33 @@ var noNestedTernary = createRule41({
3326
3497
  var no_nested_ternary_default = noNestedTernary;
3327
3498
 
3328
3499
  // src/rules/no-redundant-fragment.ts
3329
- var import_utils50 = require("@typescript-eslint/utils");
3330
- var createRule42 = import_utils50.ESLintUtils.RuleCreator(
3500
+ var import_utils54 = require("@typescript-eslint/utils");
3501
+ var createRule46 = import_utils54.ESLintUtils.RuleCreator(
3331
3502
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3332
3503
  );
3333
3504
  function isFragmentName(name) {
3334
- if (name.type === import_utils50.AST_NODE_TYPES.JSXIdentifier && name.name === "Fragment") {
3505
+ if (name.type === import_utils54.AST_NODE_TYPES.JSXIdentifier && name.name === "Fragment") {
3335
3506
  return true;
3336
3507
  }
3337
- if (name.type === import_utils50.AST_NODE_TYPES.JSXMemberExpression && name.object.type === import_utils50.AST_NODE_TYPES.JSXIdentifier && name.object.name === "React" && name.property.type === import_utils50.AST_NODE_TYPES.JSXIdentifier && name.property.name === "Fragment") {
3508
+ if (name.type === import_utils54.AST_NODE_TYPES.JSXMemberExpression && name.object.type === import_utils54.AST_NODE_TYPES.JSXIdentifier && name.object.name === "React" && name.property.type === import_utils54.AST_NODE_TYPES.JSXIdentifier && name.property.name === "Fragment") {
3338
3509
  return true;
3339
3510
  }
3340
3511
  return false;
3341
3512
  }
3342
3513
  function hasKeyAttribute(attributes) {
3343
3514
  return attributes.some(
3344
- (attribute) => attribute.type === import_utils50.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils50.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "key"
3515
+ (attribute) => attribute.type === import_utils54.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils54.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "key"
3345
3516
  );
3346
3517
  }
3347
3518
  function countMeaningfulChildren(children) {
3348
3519
  return children.filter((child) => {
3349
- if (child.type === import_utils50.AST_NODE_TYPES.JSXText) {
3520
+ if (child.type === import_utils54.AST_NODE_TYPES.JSXText) {
3350
3521
  return child.value.trim() !== "";
3351
3522
  }
3352
3523
  return true;
3353
3524
  }).length;
3354
3525
  }
3355
- var noRedundantFragment = createRule42({
3526
+ var noRedundantFragment = createRule46({
3356
3527
  name: "no-redundant-fragment",
3357
3528
  meta: {
3358
3529
  type: "problem",
@@ -3400,11 +3571,11 @@ var noRedundantFragment = createRule42({
3400
3571
  var no_redundant_fragment_default = noRedundantFragment;
3401
3572
 
3402
3573
  // src/rules/no-relative-imports.ts
3403
- var import_utils51 = require("@typescript-eslint/utils");
3404
- var createRule43 = import_utils51.ESLintUtils.RuleCreator(
3574
+ var import_utils55 = require("@typescript-eslint/utils");
3575
+ var createRule47 = import_utils55.ESLintUtils.RuleCreator(
3405
3576
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3406
3577
  );
3407
- var noRelativeImports = createRule43({
3578
+ var noRelativeImports = createRule47({
3408
3579
  name: "no-relative-imports",
3409
3580
  meta: {
3410
3581
  type: "suggestion",
@@ -3428,22 +3599,22 @@ var noRelativeImports = createRule43({
3428
3599
  };
3429
3600
  return {
3430
3601
  ImportDeclaration(node) {
3431
- if (node.source.type === import_utils51.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3602
+ if (node.source.type === import_utils55.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3432
3603
  checkImportPath(node.source.value, node);
3433
3604
  }
3434
3605
  },
3435
3606
  ImportExpression(node) {
3436
- if (node.source.type === import_utils51.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3607
+ if (node.source.type === import_utils55.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3437
3608
  checkImportPath(node.source.value, node);
3438
3609
  }
3439
3610
  },
3440
3611
  ExportNamedDeclaration(node) {
3441
- if (node.source?.type === import_utils51.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3612
+ if (node.source?.type === import_utils55.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3442
3613
  checkImportPath(node.source.value, node);
3443
3614
  }
3444
3615
  },
3445
3616
  ExportAllDeclaration(node) {
3446
- if (node.source.type === import_utils51.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3617
+ if (node.source.type === import_utils55.AST_NODE_TYPES.Literal && typeof node.source.value === "string") {
3447
3618
  checkImportPath(node.source.value, node);
3448
3619
  }
3449
3620
  }
@@ -3453,8 +3624,8 @@ var noRelativeImports = createRule43({
3453
3624
  var no_relative_imports_default = noRelativeImports;
3454
3625
 
3455
3626
  // src/rules/no-single-char-variables.ts
3456
- var import_utils52 = require("@typescript-eslint/utils");
3457
- var createRule44 = import_utils52.ESLintUtils.RuleCreator(
3627
+ var import_utils56 = require("@typescript-eslint/utils");
3628
+ var createRule48 = import_utils56.ESLintUtils.RuleCreator(
3458
3629
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3459
3630
  );
3460
3631
  var ALLOWED_IN_FOR_LOOPS = /* @__PURE__ */ new Set(["i", "j", "k", "n"]);
@@ -3466,7 +3637,7 @@ var isForLoopInit = (node) => {
3466
3637
  if (!parentNode) {
3467
3638
  return false;
3468
3639
  }
3469
- if (parentNode.type === import_utils52.AST_NODE_TYPES.ForStatement) {
3640
+ if (parentNode.type === import_utils56.AST_NODE_TYPES.ForStatement) {
3470
3641
  const { init } = parentNode;
3471
3642
  if (init && init === current) {
3472
3643
  return true;
@@ -3485,7 +3656,7 @@ var isAllowedInContext = (name, node) => {
3485
3656
  }
3486
3657
  return false;
3487
3658
  };
3488
- var noSingleCharVariables = createRule44({
3659
+ var noSingleCharVariables = createRule48({
3489
3660
  name: "no-single-char-variables",
3490
3661
  meta: {
3491
3662
  type: "suggestion",
@@ -3514,27 +3685,27 @@ var noSingleCharVariables = createRule44({
3514
3685
  });
3515
3686
  };
3516
3687
  const checkPattern = (pattern, declarationNode) => {
3517
- if (pattern.type === import_utils52.AST_NODE_TYPES.Identifier) {
3688
+ if (pattern.type === import_utils56.AST_NODE_TYPES.Identifier) {
3518
3689
  checkIdentifier(pattern, declarationNode);
3519
- } else if (pattern.type === import_utils52.AST_NODE_TYPES.ObjectPattern) {
3690
+ } else if (pattern.type === import_utils56.AST_NODE_TYPES.ObjectPattern) {
3520
3691
  pattern.properties.forEach((prop) => {
3521
- if (prop.type === import_utils52.AST_NODE_TYPES.Property && prop.value.type === import_utils52.AST_NODE_TYPES.Identifier) {
3692
+ if (prop.type === import_utils56.AST_NODE_TYPES.Property && prop.value.type === import_utils56.AST_NODE_TYPES.Identifier) {
3522
3693
  checkIdentifier(prop.value, declarationNode);
3523
- } else if (prop.type === import_utils52.AST_NODE_TYPES.RestElement && prop.argument.type === import_utils52.AST_NODE_TYPES.Identifier) {
3694
+ } else if (prop.type === import_utils56.AST_NODE_TYPES.RestElement && prop.argument.type === import_utils56.AST_NODE_TYPES.Identifier) {
3524
3695
  checkIdentifier(prop.argument, declarationNode);
3525
3696
  }
3526
3697
  });
3527
- } else if (pattern.type === import_utils52.AST_NODE_TYPES.ArrayPattern) {
3698
+ } else if (pattern.type === import_utils56.AST_NODE_TYPES.ArrayPattern) {
3528
3699
  pattern.elements.forEach((element) => {
3529
- if (element?.type === import_utils52.AST_NODE_TYPES.Identifier) {
3700
+ if (element?.type === import_utils56.AST_NODE_TYPES.Identifier) {
3530
3701
  checkIdentifier(element, declarationNode);
3531
- } else if (element?.type === import_utils52.AST_NODE_TYPES.RestElement && element.argument.type === import_utils52.AST_NODE_TYPES.Identifier) {
3702
+ } else if (element?.type === import_utils56.AST_NODE_TYPES.RestElement && element.argument.type === import_utils56.AST_NODE_TYPES.Identifier) {
3532
3703
  checkIdentifier(element.argument, declarationNode);
3533
3704
  }
3534
3705
  });
3535
- } else if (pattern.type === import_utils52.AST_NODE_TYPES.AssignmentPattern && pattern.left.type === import_utils52.AST_NODE_TYPES.Identifier) {
3706
+ } else if (pattern.type === import_utils56.AST_NODE_TYPES.AssignmentPattern && pattern.left.type === import_utils56.AST_NODE_TYPES.Identifier) {
3536
3707
  checkIdentifier(pattern.left, declarationNode);
3537
- } else if (pattern.type === import_utils52.AST_NODE_TYPES.RestElement && pattern.argument.type === import_utils52.AST_NODE_TYPES.Identifier) {
3708
+ } else if (pattern.type === import_utils56.AST_NODE_TYPES.RestElement && pattern.argument.type === import_utils56.AST_NODE_TYPES.Identifier) {
3538
3709
  checkIdentifier(pattern.argument, declarationNode);
3539
3710
  }
3540
3711
  };
@@ -3568,11 +3739,11 @@ var noSingleCharVariables = createRule44({
3568
3739
  var no_single_char_variables_default = noSingleCharVariables;
3569
3740
 
3570
3741
  // src/rules/prefer-async-await.ts
3571
- var import_utils53 = require("@typescript-eslint/utils");
3572
- var createRule45 = import_utils53.ESLintUtils.RuleCreator(
3742
+ var import_utils57 = require("@typescript-eslint/utils");
3743
+ var createRule49 = import_utils57.ESLintUtils.RuleCreator(
3573
3744
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3574
3745
  );
3575
- var preferAsyncAwait = createRule45({
3746
+ var preferAsyncAwait = createRule49({
3576
3747
  name: "prefer-async-await",
3577
3748
  meta: {
3578
3749
  type: "suggestion",
@@ -3588,7 +3759,7 @@ var preferAsyncAwait = createRule45({
3588
3759
  create(context) {
3589
3760
  return {
3590
3761
  CallExpression(node) {
3591
- if (node.callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && node.callee.property.type === import_utils53.AST_NODE_TYPES.Identifier && node.callee.property.name === "then") {
3762
+ if (node.callee.type === import_utils57.AST_NODE_TYPES.MemberExpression && node.callee.property.type === import_utils57.AST_NODE_TYPES.Identifier && node.callee.property.name === "then") {
3592
3763
  context.report({
3593
3764
  node: node.callee.property,
3594
3765
  messageId: "preferAsyncAwait"
@@ -3601,11 +3772,11 @@ var preferAsyncAwait = createRule45({
3601
3772
  var prefer_async_await_default = preferAsyncAwait;
3602
3773
 
3603
3774
  // src/rules/prefer-destructuring-params.ts
3604
- var import_utils54 = require("@typescript-eslint/utils");
3605
- var createRule46 = import_utils54.ESLintUtils.RuleCreator(
3775
+ var import_utils58 = require("@typescript-eslint/utils");
3776
+ var createRule50 = import_utils58.ESLintUtils.RuleCreator(
3606
3777
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3607
3778
  );
3608
- var preferDestructuringParams = createRule46({
3779
+ var preferDestructuringParams = createRule50({
3609
3780
  name: "prefer-destructuring-params",
3610
3781
  meta: {
3611
3782
  type: "suggestion",
@@ -3621,18 +3792,18 @@ var preferDestructuringParams = createRule46({
3621
3792
  create(context) {
3622
3793
  const isCallbackFunction2 = (node) => {
3623
3794
  const { parent } = node;
3624
- return parent?.type === import_utils54.AST_NODE_TYPES.CallExpression;
3795
+ return parent?.type === import_utils58.AST_NODE_TYPES.CallExpression;
3625
3796
  };
3626
3797
  const isDeveloperFunction = (node) => {
3627
- if (node.type === import_utils54.AST_NODE_TYPES.FunctionDeclaration) {
3798
+ if (node.type === import_utils58.AST_NODE_TYPES.FunctionDeclaration) {
3628
3799
  return true;
3629
3800
  }
3630
- if (node.type === import_utils54.AST_NODE_TYPES.FunctionExpression || node.type === import_utils54.AST_NODE_TYPES.ArrowFunctionExpression) {
3801
+ if (node.type === import_utils58.AST_NODE_TYPES.FunctionExpression || node.type === import_utils58.AST_NODE_TYPES.ArrowFunctionExpression) {
3631
3802
  if (isCallbackFunction2(node)) {
3632
3803
  return false;
3633
3804
  }
3634
3805
  const { parent } = node;
3635
- return parent?.type === import_utils54.AST_NODE_TYPES.VariableDeclarator || parent?.type === import_utils54.AST_NODE_TYPES.AssignmentExpression || parent?.type === import_utils54.AST_NODE_TYPES.Property || parent?.type === import_utils54.AST_NODE_TYPES.MethodDefinition;
3806
+ return parent?.type === import_utils58.AST_NODE_TYPES.VariableDeclarator || parent?.type === import_utils58.AST_NODE_TYPES.AssignmentExpression || parent?.type === import_utils58.AST_NODE_TYPES.Property || parent?.type === import_utils58.AST_NODE_TYPES.MethodDefinition;
3636
3807
  }
3637
3808
  return false;
3638
3809
  };
@@ -3644,7 +3815,7 @@ var preferDestructuringParams = createRule46({
3644
3815
  if (!isDeveloperFunction(node)) {
3645
3816
  return;
3646
3817
  }
3647
- if (node.type === import_utils54.AST_NODE_TYPES.FunctionDeclaration && node.id) {
3818
+ if (node.type === import_utils58.AST_NODE_TYPES.FunctionDeclaration && node.id) {
3648
3819
  const functionName = node.id.name;
3649
3820
  if (functionName.startsWith("_") || functionName.includes("$") || /^[A-Z][a-zA-Z]*$/.test(functionName)) {
3650
3821
  return;
@@ -3654,7 +3825,7 @@ var preferDestructuringParams = createRule46({
3654
3825
  return;
3655
3826
  }
3656
3827
  const hasNonDestructuredParams = node.params.some(
3657
- (param) => param.type !== import_utils54.AST_NODE_TYPES.ObjectPattern && param.type !== import_utils54.AST_NODE_TYPES.RestElement
3828
+ (param) => param.type !== import_utils58.AST_NODE_TYPES.ObjectPattern && param.type !== import_utils58.AST_NODE_TYPES.RestElement
3658
3829
  );
3659
3830
  if (hasNonDestructuredParams) {
3660
3831
  context.report({
@@ -3673,8 +3844,8 @@ var preferDestructuringParams = createRule46({
3673
3844
  var prefer_destructuring_params_default = preferDestructuringParams;
3674
3845
 
3675
3846
  // src/rules/prefer-function-declaration.ts
3676
- var import_utils55 = require("@typescript-eslint/utils");
3677
- var createRule47 = import_utils55.ESLintUtils.RuleCreator(
3847
+ var import_utils59 = require("@typescript-eslint/utils");
3848
+ var createRule51 = import_utils59.ESLintUtils.RuleCreator(
3678
3849
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3679
3850
  );
3680
3851
  var isTsFile = (filename) => filename.endsWith(".ts") && !filename.endsWith(".d.ts");
@@ -3683,33 +3854,33 @@ var isCallbackContext = (node) => {
3683
3854
  if (!parent) {
3684
3855
  return false;
3685
3856
  }
3686
- if (parent.type === import_utils55.AST_NODE_TYPES.CallExpression && parent.arguments.includes(node)) {
3857
+ if (parent.type === import_utils59.AST_NODE_TYPES.CallExpression && parent.arguments.includes(node)) {
3687
3858
  return true;
3688
3859
  }
3689
- if (parent.type === import_utils55.AST_NODE_TYPES.NewExpression && parent.arguments.includes(node)) {
3860
+ if (parent.type === import_utils59.AST_NODE_TYPES.NewExpression && parent.arguments.includes(node)) {
3690
3861
  return true;
3691
3862
  }
3692
- if (parent.type === import_utils55.AST_NODE_TYPES.ReturnStatement) {
3863
+ if (parent.type === import_utils59.AST_NODE_TYPES.ReturnStatement) {
3693
3864
  return true;
3694
3865
  }
3695
- if (parent.type === import_utils55.AST_NODE_TYPES.Property) {
3866
+ if (parent.type === import_utils59.AST_NODE_TYPES.Property) {
3696
3867
  return true;
3697
3868
  }
3698
- if (parent.type === import_utils55.AST_NODE_TYPES.ArrayExpression) {
3869
+ if (parent.type === import_utils59.AST_NODE_TYPES.ArrayExpression) {
3699
3870
  return true;
3700
3871
  }
3701
- if (parent.type === import_utils55.AST_NODE_TYPES.ConditionalExpression) {
3872
+ if (parent.type === import_utils59.AST_NODE_TYPES.ConditionalExpression) {
3702
3873
  return true;
3703
3874
  }
3704
- if (parent.type === import_utils55.AST_NODE_TYPES.LogicalExpression) {
3875
+ if (parent.type === import_utils59.AST_NODE_TYPES.LogicalExpression) {
3705
3876
  return true;
3706
3877
  }
3707
- if (parent.type === import_utils55.AST_NODE_TYPES.AssignmentExpression && parent.left !== node) {
3878
+ if (parent.type === import_utils59.AST_NODE_TYPES.AssignmentExpression && parent.left !== node) {
3708
3879
  return true;
3709
3880
  }
3710
3881
  return false;
3711
3882
  };
3712
- var preferFunctionDeclaration = createRule47({
3883
+ var preferFunctionDeclaration = createRule51({
3713
3884
  name: "prefer-function-declaration",
3714
3885
  meta: {
3715
3886
  type: "suggestion",
@@ -3730,14 +3901,14 @@ var preferFunctionDeclaration = createRule47({
3730
3901
  }
3731
3902
  return {
3732
3903
  VariableDeclarator(node) {
3733
- if (node.id.type !== import_utils55.AST_NODE_TYPES.Identifier) {
3904
+ if (node.id.type !== import_utils59.AST_NODE_TYPES.Identifier) {
3734
3905
  return;
3735
3906
  }
3736
3907
  const { init } = node;
3737
3908
  if (!init) {
3738
3909
  return;
3739
3910
  }
3740
- if (init.type === import_utils55.AST_NODE_TYPES.ArrowFunctionExpression) {
3911
+ if (init.type === import_utils59.AST_NODE_TYPES.ArrowFunctionExpression) {
3741
3912
  if (isCallbackContext(init)) {
3742
3913
  return;
3743
3914
  }
@@ -3747,7 +3918,7 @@ var preferFunctionDeclaration = createRule47({
3747
3918
  data: { name: node.id.name }
3748
3919
  });
3749
3920
  }
3750
- if (init.type === import_utils55.AST_NODE_TYPES.FunctionExpression) {
3921
+ if (init.type === import_utils59.AST_NODE_TYPES.FunctionExpression) {
3751
3922
  if (isCallbackContext(init)) {
3752
3923
  return;
3753
3924
  }
@@ -3764,11 +3935,11 @@ var preferFunctionDeclaration = createRule47({
3764
3935
  var prefer_function_declaration_default = preferFunctionDeclaration;
3765
3936
 
3766
3937
  // src/rules/prefer-guard-clause.ts
3767
- var import_utils56 = require("@typescript-eslint/utils");
3768
- var createRule48 = import_utils56.ESLintUtils.RuleCreator(
3938
+ var import_utils60 = require("@typescript-eslint/utils");
3939
+ var createRule52 = import_utils60.ESLintUtils.RuleCreator(
3769
3940
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3770
3941
  );
3771
- var preferGuardClause = createRule48({
3942
+ var preferGuardClause = createRule52({
3772
3943
  name: "prefer-guard-clause",
3773
3944
  meta: {
3774
3945
  type: "suggestion",
@@ -3785,8 +3956,8 @@ var preferGuardClause = createRule48({
3785
3956
  return {
3786
3957
  IfStatement(node) {
3787
3958
  const { consequent } = node;
3788
- if (consequent.type === import_utils56.AST_NODE_TYPES.BlockStatement) {
3789
- const hasNestedIf = consequent.body.some((statement) => statement.type === import_utils56.AST_NODE_TYPES.IfStatement);
3959
+ if (consequent.type === import_utils60.AST_NODE_TYPES.BlockStatement) {
3960
+ const hasNestedIf = consequent.body.some((statement) => statement.type === import_utils60.AST_NODE_TYPES.IfStatement);
3790
3961
  if (hasNestedIf && consequent.body.length === 1) {
3791
3962
  context.report({
3792
3963
  node,
@@ -3794,7 +3965,7 @@ var preferGuardClause = createRule48({
3794
3965
  });
3795
3966
  }
3796
3967
  }
3797
- if (consequent.type === import_utils56.AST_NODE_TYPES.IfStatement) {
3968
+ if (consequent.type === import_utils60.AST_NODE_TYPES.IfStatement) {
3798
3969
  context.report({
3799
3970
  node,
3800
3971
  messageId: "preferGuardClause"
@@ -3807,11 +3978,11 @@ var preferGuardClause = createRule48({
3807
3978
  var prefer_guard_clause_default = preferGuardClause;
3808
3979
 
3809
3980
  // src/rules/prefer-import-type.ts
3810
- var import_utils57 = require("@typescript-eslint/utils");
3811
- var createRule49 = import_utils57.ESLintUtils.RuleCreator(
3981
+ var import_utils61 = require("@typescript-eslint/utils");
3982
+ var createRule53 = import_utils61.ESLintUtils.RuleCreator(
3812
3983
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3813
3984
  );
3814
- var preferImportType = createRule49({
3985
+ var preferImportType = createRule53({
3815
3986
  name: "prefer-import-type",
3816
3987
  meta: {
3817
3988
  type: "suggestion",
@@ -3830,22 +4001,22 @@ var preferImportType = createRule49({
3830
4001
  let current = node;
3831
4002
  while (current) {
3832
4003
  switch (current.type) {
3833
- case import_utils57.AST_NODE_TYPES.TSTypeReference:
3834
- case import_utils57.AST_NODE_TYPES.TSTypeAnnotation:
3835
- case import_utils57.AST_NODE_TYPES.TSTypeParameterInstantiation:
3836
- case import_utils57.AST_NODE_TYPES.TSInterfaceHeritage:
3837
- case import_utils57.AST_NODE_TYPES.TSClassImplements:
3838
- case import_utils57.AST_NODE_TYPES.TSTypeQuery:
3839
- case import_utils57.AST_NODE_TYPES.TSTypeAssertion:
3840
- case import_utils57.AST_NODE_TYPES.TSAsExpression:
3841
- case import_utils57.AST_NODE_TYPES.TSSatisfiesExpression:
3842
- case import_utils57.AST_NODE_TYPES.TSTypeAliasDeclaration:
3843
- case import_utils57.AST_NODE_TYPES.TSInterfaceDeclaration:
3844
- case import_utils57.AST_NODE_TYPES.TSTypeParameter:
3845
- case import_utils57.AST_NODE_TYPES.TSQualifiedName:
4004
+ case import_utils61.AST_NODE_TYPES.TSTypeReference:
4005
+ case import_utils61.AST_NODE_TYPES.TSTypeAnnotation:
4006
+ case import_utils61.AST_NODE_TYPES.TSTypeParameterInstantiation:
4007
+ case import_utils61.AST_NODE_TYPES.TSInterfaceHeritage:
4008
+ case import_utils61.AST_NODE_TYPES.TSClassImplements:
4009
+ case import_utils61.AST_NODE_TYPES.TSTypeQuery:
4010
+ case import_utils61.AST_NODE_TYPES.TSTypeAssertion:
4011
+ case import_utils61.AST_NODE_TYPES.TSAsExpression:
4012
+ case import_utils61.AST_NODE_TYPES.TSSatisfiesExpression:
4013
+ case import_utils61.AST_NODE_TYPES.TSTypeAliasDeclaration:
4014
+ case import_utils61.AST_NODE_TYPES.TSInterfaceDeclaration:
4015
+ case import_utils61.AST_NODE_TYPES.TSTypeParameter:
4016
+ case import_utils61.AST_NODE_TYPES.TSQualifiedName:
3846
4017
  return true;
3847
- case import_utils57.AST_NODE_TYPES.MemberExpression:
3848
- case import_utils57.AST_NODE_TYPES.Identifier:
4018
+ case import_utils61.AST_NODE_TYPES.MemberExpression:
4019
+ case import_utils61.AST_NODE_TYPES.Identifier:
3849
4020
  current = current.parent;
3850
4021
  break;
3851
4022
  default:
@@ -3875,27 +4046,27 @@ var preferImportType = createRule49({
3875
4046
  return false;
3876
4047
  }
3877
4048
  switch (parent.type) {
3878
- case import_utils57.AST_NODE_TYPES.CallExpression:
3879
- case import_utils57.AST_NODE_TYPES.NewExpression:
3880
- case import_utils57.AST_NODE_TYPES.JSXOpeningElement:
3881
- case import_utils57.AST_NODE_TYPES.JSXClosingElement:
3882
- case import_utils57.AST_NODE_TYPES.MemberExpression:
3883
- case import_utils57.AST_NODE_TYPES.VariableDeclarator:
3884
- case import_utils57.AST_NODE_TYPES.TaggedTemplateExpression:
3885
- case import_utils57.AST_NODE_TYPES.SpreadElement:
3886
- case import_utils57.AST_NODE_TYPES.ExportSpecifier:
3887
- case import_utils57.AST_NODE_TYPES.ArrayExpression:
3888
- case import_utils57.AST_NODE_TYPES.ObjectExpression:
3889
- case import_utils57.AST_NODE_TYPES.BinaryExpression:
3890
- case import_utils57.AST_NODE_TYPES.LogicalExpression:
3891
- case import_utils57.AST_NODE_TYPES.UnaryExpression:
3892
- case import_utils57.AST_NODE_TYPES.ReturnStatement:
3893
- case import_utils57.AST_NODE_TYPES.ArrowFunctionExpression:
3894
- case import_utils57.AST_NODE_TYPES.ConditionalExpression:
3895
- case import_utils57.AST_NODE_TYPES.AwaitExpression:
3896
- case import_utils57.AST_NODE_TYPES.YieldExpression:
3897
- case import_utils57.AST_NODE_TYPES.Property:
3898
- case import_utils57.AST_NODE_TYPES.JSXExpressionContainer:
4049
+ case import_utils61.AST_NODE_TYPES.CallExpression:
4050
+ case import_utils61.AST_NODE_TYPES.NewExpression:
4051
+ case import_utils61.AST_NODE_TYPES.JSXOpeningElement:
4052
+ case import_utils61.AST_NODE_TYPES.JSXClosingElement:
4053
+ case import_utils61.AST_NODE_TYPES.MemberExpression:
4054
+ case import_utils61.AST_NODE_TYPES.VariableDeclarator:
4055
+ case import_utils61.AST_NODE_TYPES.TaggedTemplateExpression:
4056
+ case import_utils61.AST_NODE_TYPES.SpreadElement:
4057
+ case import_utils61.AST_NODE_TYPES.ExportSpecifier:
4058
+ case import_utils61.AST_NODE_TYPES.ArrayExpression:
4059
+ case import_utils61.AST_NODE_TYPES.ObjectExpression:
4060
+ case import_utils61.AST_NODE_TYPES.BinaryExpression:
4061
+ case import_utils61.AST_NODE_TYPES.LogicalExpression:
4062
+ case import_utils61.AST_NODE_TYPES.UnaryExpression:
4063
+ case import_utils61.AST_NODE_TYPES.ReturnStatement:
4064
+ case import_utils61.AST_NODE_TYPES.ArrowFunctionExpression:
4065
+ case import_utils61.AST_NODE_TYPES.ConditionalExpression:
4066
+ case import_utils61.AST_NODE_TYPES.AwaitExpression:
4067
+ case import_utils61.AST_NODE_TYPES.YieldExpression:
4068
+ case import_utils61.AST_NODE_TYPES.Property:
4069
+ case import_utils61.AST_NODE_TYPES.JSXExpressionContainer:
3899
4070
  return true;
3900
4071
  default:
3901
4072
  return false;
@@ -3907,7 +4078,7 @@ var preferImportType = createRule49({
3907
4078
  return;
3908
4079
  }
3909
4080
  const hasInlineTypeSpecifier = node.specifiers.some(
3910
- (specifier) => specifier.type === import_utils57.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type"
4081
+ (specifier) => specifier.type === import_utils61.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type"
3911
4082
  );
3912
4083
  if (hasInlineTypeSpecifier) {
3913
4084
  return;
@@ -3925,13 +4096,13 @@ var preferImportType = createRule49({
3925
4096
  }
3926
4097
  const scope = context.sourceCode.getScope(node);
3927
4098
  const isTypeOnlyImport2 = node.specifiers.every((specifier) => {
3928
- if (specifier.type === import_utils57.AST_NODE_TYPES.ImportDefaultSpecifier) {
4099
+ if (specifier.type === import_utils61.AST_NODE_TYPES.ImportDefaultSpecifier) {
3929
4100
  return false;
3930
4101
  }
3931
- if (specifier.type === import_utils57.AST_NODE_TYPES.ImportNamespaceSpecifier) {
4102
+ if (specifier.type === import_utils61.AST_NODE_TYPES.ImportNamespaceSpecifier) {
3932
4103
  return false;
3933
4104
  }
3934
- if (specifier.type === import_utils57.AST_NODE_TYPES.ImportSpecifier) {
4105
+ if (specifier.type === import_utils61.AST_NODE_TYPES.ImportSpecifier) {
3935
4106
  const localName = specifier.local.name;
3936
4107
  return !isUsedAsValue(localName, scope);
3937
4108
  }
@@ -3957,19 +4128,19 @@ var preferImportType = createRule49({
3957
4128
  var prefer_import_type_default = preferImportType;
3958
4129
 
3959
4130
  // src/rules/prefer-inline-literal-union.ts
3960
- var import_utils58 = require("@typescript-eslint/utils");
3961
- var createRule50 = import_utils58.ESLintUtils.RuleCreator(
4131
+ var import_utils62 = require("@typescript-eslint/utils");
4132
+ var createRule54 = import_utils62.ESLintUtils.RuleCreator(
3962
4133
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
3963
4134
  );
3964
4135
  function isLiteralUnionType(node) {
3965
- if (node.type !== import_utils58.AST_NODE_TYPES.TSUnionType) {
4136
+ if (node.type !== import_utils62.AST_NODE_TYPES.TSUnionType) {
3966
4137
  return false;
3967
4138
  }
3968
4139
  return node.types.every(
3969
- (member) => member.type === import_utils58.AST_NODE_TYPES.TSLiteralType || member.type === import_utils58.AST_NODE_TYPES.TSNullKeyword || member.type === import_utils58.AST_NODE_TYPES.TSUndefinedKeyword
4140
+ (member) => member.type === import_utils62.AST_NODE_TYPES.TSLiteralType || member.type === import_utils62.AST_NODE_TYPES.TSNullKeyword || member.type === import_utils62.AST_NODE_TYPES.TSUndefinedKeyword
3970
4141
  );
3971
4142
  }
3972
- var preferInlineLiteralUnion = createRule50({
4143
+ var preferInlineLiteralUnion = createRule54({
3973
4144
  name: "prefer-inline-literal-union",
3974
4145
  meta: {
3975
4146
  type: "suggestion",
@@ -3996,10 +4167,10 @@ var preferInlineLiteralUnion = createRule50({
3996
4167
  return;
3997
4168
  }
3998
4169
  const { typeAnnotation } = node.typeAnnotation;
3999
- if (typeAnnotation.type !== import_utils58.AST_NODE_TYPES.TSTypeReference) {
4170
+ if (typeAnnotation.type !== import_utils62.AST_NODE_TYPES.TSTypeReference) {
4000
4171
  return;
4001
4172
  }
4002
- if (typeAnnotation.typeName.type !== import_utils58.AST_NODE_TYPES.Identifier) {
4173
+ if (typeAnnotation.typeName.type !== import_utils62.AST_NODE_TYPES.Identifier) {
4003
4174
  return;
4004
4175
  }
4005
4176
  const aliasName = typeAnnotation.typeName.name;
@@ -4023,12 +4194,12 @@ var preferInlineLiteralUnion = createRule50({
4023
4194
  var prefer_inline_literal_union_default = preferInlineLiteralUnion;
4024
4195
 
4025
4196
  // src/rules/prefer-inline-type-export.ts
4026
- var import_utils59 = require("@typescript-eslint/utils");
4027
- var createRule51 = import_utils59.ESLintUtils.RuleCreator(
4197
+ var import_utils63 = require("@typescript-eslint/utils");
4198
+ var createRule55 = import_utils63.ESLintUtils.RuleCreator(
4028
4199
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4029
4200
  );
4030
- var isTypeDeclaration = (node) => node.type === import_utils59.AST_NODE_TYPES.TSInterfaceDeclaration || node.type === import_utils59.AST_NODE_TYPES.TSTypeAliasDeclaration;
4031
- var preferInlineTypeExport = createRule51({
4201
+ var isTypeDeclaration = (node) => node.type === import_utils63.AST_NODE_TYPES.TSInterfaceDeclaration || node.type === import_utils63.AST_NODE_TYPES.TSTypeAliasDeclaration;
4202
+ var preferInlineTypeExport = createRule55({
4032
4203
  name: "prefer-inline-type-export",
4033
4204
  meta: {
4034
4205
  type: "suggestion",
@@ -4045,12 +4216,12 @@ var preferInlineTypeExport = createRule51({
4045
4216
  create(context) {
4046
4217
  const typeDeclarations = /* @__PURE__ */ new Map();
4047
4218
  function collectDeclaration(node) {
4048
- if (node.parent.type !== import_utils59.AST_NODE_TYPES.ExportNamedDeclaration) {
4219
+ if (node.parent.type !== import_utils63.AST_NODE_TYPES.ExportNamedDeclaration) {
4049
4220
  typeDeclarations.set(node.id.name, node);
4050
4221
  }
4051
4222
  }
4052
4223
  function reportSpecifier(specifier, statement, declarationNode) {
4053
- if (specifier.local.type !== import_utils59.AST_NODE_TYPES.Identifier) {
4224
+ if (specifier.local.type !== import_utils63.AST_NODE_TYPES.Identifier) {
4054
4225
  return;
4055
4226
  }
4056
4227
  const { name } = specifier.local;
@@ -4083,16 +4254,16 @@ var preferInlineTypeExport = createRule51({
4083
4254
  return {
4084
4255
  Program(node) {
4085
4256
  node.body.forEach((statement) => {
4086
- if (statement.type === import_utils59.AST_NODE_TYPES.TSInterfaceDeclaration || statement.type === import_utils59.AST_NODE_TYPES.TSTypeAliasDeclaration) {
4257
+ if (statement.type === import_utils63.AST_NODE_TYPES.TSInterfaceDeclaration || statement.type === import_utils63.AST_NODE_TYPES.TSTypeAliasDeclaration) {
4087
4258
  collectDeclaration(statement);
4088
4259
  }
4089
4260
  });
4090
4261
  node.body.forEach((statement) => {
4091
- if (statement.type !== import_utils59.AST_NODE_TYPES.ExportNamedDeclaration || statement.declaration !== null) {
4262
+ if (statement.type !== import_utils63.AST_NODE_TYPES.ExportNamedDeclaration || statement.declaration !== null) {
4092
4263
  return;
4093
4264
  }
4094
4265
  statement.specifiers.forEach((specifier) => {
4095
- if (specifier.local.type !== import_utils59.AST_NODE_TYPES.Identifier) {
4266
+ if (specifier.local.type !== import_utils63.AST_NODE_TYPES.Identifier) {
4096
4267
  return;
4097
4268
  }
4098
4269
  const declarationNode = typeDeclarations.get(specifier.local.name);
@@ -4109,11 +4280,11 @@ var preferInlineTypeExport = createRule51({
4109
4280
  var prefer_inline_type_export_default = preferInlineTypeExport;
4110
4281
 
4111
4282
  // src/rules/prefer-interface-for-component-props.ts
4112
- var import_utils60 = require("@typescript-eslint/utils");
4113
- var createRule52 = import_utils60.ESLintUtils.RuleCreator(
4283
+ var import_utils64 = require("@typescript-eslint/utils");
4284
+ var createRule56 = import_utils64.ESLintUtils.RuleCreator(
4114
4285
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4115
4286
  );
4116
- var preferInterfaceForComponentProps = createRule52({
4287
+ var preferInterfaceForComponentProps = createRule56({
4117
4288
  name: "prefer-interface-for-component-props",
4118
4289
  meta: {
4119
4290
  type: "suggestion",
@@ -4133,13 +4304,13 @@ var preferInterfaceForComponentProps = createRule52({
4133
4304
  }
4134
4305
  return {
4135
4306
  TSTypeAliasDeclaration(node) {
4136
- if (node.id.type !== import_utils60.AST_NODE_TYPES.Identifier) {
4307
+ if (node.id.type !== import_utils64.AST_NODE_TYPES.Identifier) {
4137
4308
  return;
4138
4309
  }
4139
4310
  if (!node.id.name.endsWith("Props")) {
4140
4311
  return;
4141
4312
  }
4142
- if (node.typeAnnotation.type !== import_utils60.AST_NODE_TYPES.TSTypeLiteral) {
4313
+ if (node.typeAnnotation.type !== import_utils64.AST_NODE_TYPES.TSTypeLiteral) {
4143
4314
  return;
4144
4315
  }
4145
4316
  const { name } = node.id;
@@ -4166,11 +4337,11 @@ var preferInterfaceForComponentProps = createRule52({
4166
4337
  var prefer_interface_for_component_props_default = preferInterfaceForComponentProps;
4167
4338
 
4168
4339
  // src/rules/prefer-interface-over-inline-types.ts
4169
- var import_utils62 = require("@typescript-eslint/utils");
4170
- var createRule53 = import_utils62.ESLintUtils.RuleCreator(
4340
+ var import_utils66 = require("@typescript-eslint/utils");
4341
+ var createRule57 = import_utils66.ESLintUtils.RuleCreator(
4171
4342
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4172
4343
  );
4173
- var preferInterfaceOverInlineTypes = createRule53({
4344
+ var preferInterfaceOverInlineTypes = createRule57({
4174
4345
  name: "prefer-interface-over-inline-types",
4175
4346
  meta: {
4176
4347
  type: "suggestion",
@@ -4186,54 +4357,54 @@ var preferInterfaceOverInlineTypes = createRule53({
4186
4357
  defaultOptions: [],
4187
4358
  create(context) {
4188
4359
  function hasJSXInConditional(node) {
4189
- return node.consequent.type === import_utils62.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils62.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils62.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils62.AST_NODE_TYPES.JSXFragment;
4360
+ return node.consequent.type === import_utils66.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils66.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils66.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils66.AST_NODE_TYPES.JSXFragment;
4190
4361
  }
4191
4362
  function hasJSXInLogical(node) {
4192
- return node.right.type === import_utils62.AST_NODE_TYPES.JSXElement || node.right.type === import_utils62.AST_NODE_TYPES.JSXFragment;
4363
+ return node.right.type === import_utils66.AST_NODE_TYPES.JSXElement || node.right.type === import_utils66.AST_NODE_TYPES.JSXFragment;
4193
4364
  }
4194
4365
  function hasJSXReturn(block) {
4195
4366
  return block.body.some((stmt) => {
4196
- if (stmt.type === import_utils62.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
4197
- return stmt.argument.type === import_utils62.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils62.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils62.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils62.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
4367
+ if (stmt.type === import_utils66.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
4368
+ return stmt.argument.type === import_utils66.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils66.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils66.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils66.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
4198
4369
  }
4199
4370
  return false;
4200
4371
  });
4201
4372
  }
4202
4373
  function isReactComponent2(node) {
4203
- if (node.type === import_utils62.AST_NODE_TYPES.ArrowFunctionExpression) {
4204
- if (node.body.type === import_utils62.AST_NODE_TYPES.JSXElement || node.body.type === import_utils62.AST_NODE_TYPES.JSXFragment) {
4374
+ if (node.type === import_utils66.AST_NODE_TYPES.ArrowFunctionExpression) {
4375
+ if (node.body.type === import_utils66.AST_NODE_TYPES.JSXElement || node.body.type === import_utils66.AST_NODE_TYPES.JSXFragment) {
4205
4376
  return true;
4206
4377
  }
4207
- if (node.body.type === import_utils62.AST_NODE_TYPES.BlockStatement) {
4378
+ if (node.body.type === import_utils66.AST_NODE_TYPES.BlockStatement) {
4208
4379
  return hasJSXReturn(node.body);
4209
4380
  }
4210
- } else if (node.type === import_utils62.AST_NODE_TYPES.FunctionExpression || node.type === import_utils62.AST_NODE_TYPES.FunctionDeclaration) {
4211
- if (node.body && node.body.type === import_utils62.AST_NODE_TYPES.BlockStatement) {
4381
+ } else if (node.type === import_utils66.AST_NODE_TYPES.FunctionExpression || node.type === import_utils66.AST_NODE_TYPES.FunctionDeclaration) {
4382
+ if (node.body && node.body.type === import_utils66.AST_NODE_TYPES.BlockStatement) {
4212
4383
  return hasJSXReturn(node.body);
4213
4384
  }
4214
4385
  }
4215
4386
  return false;
4216
4387
  }
4217
4388
  function isInlineTypeAnnotation(node) {
4218
- if (node.type === import_utils62.AST_NODE_TYPES.TSTypeLiteral) {
4389
+ if (node.type === import_utils66.AST_NODE_TYPES.TSTypeLiteral) {
4219
4390
  return true;
4220
4391
  }
4221
- if (node.type === import_utils62.AST_NODE_TYPES.TSTypeReference && node.typeArguments) {
4222
- return node.typeArguments.params.some((param) => param.type === import_utils62.AST_NODE_TYPES.TSTypeLiteral);
4392
+ if (node.type === import_utils66.AST_NODE_TYPES.TSTypeReference && node.typeArguments) {
4393
+ return node.typeArguments.params.some((param) => param.type === import_utils66.AST_NODE_TYPES.TSTypeLiteral);
4223
4394
  }
4224
- if (node.type === import_utils62.AST_NODE_TYPES.TSUnionType) {
4395
+ if (node.type === import_utils66.AST_NODE_TYPES.TSUnionType) {
4225
4396
  return node.types.some((type) => isInlineTypeAnnotation(type));
4226
4397
  }
4227
4398
  return false;
4228
4399
  }
4229
4400
  function hasInlineObjectType(node) {
4230
- if (node.type === import_utils62.AST_NODE_TYPES.TSTypeLiteral) {
4401
+ if (node.type === import_utils66.AST_NODE_TYPES.TSTypeLiteral) {
4231
4402
  return true;
4232
4403
  }
4233
- if (node.type === import_utils62.AST_NODE_TYPES.TSTypeReference && node.typeArguments) {
4234
- return node.typeArguments.params.some((param) => param.type === import_utils62.AST_NODE_TYPES.TSTypeLiteral);
4404
+ if (node.type === import_utils66.AST_NODE_TYPES.TSTypeReference && node.typeArguments) {
4405
+ return node.typeArguments.params.some((param) => param.type === import_utils66.AST_NODE_TYPES.TSTypeLiteral);
4235
4406
  }
4236
- if (node.type === import_utils62.AST_NODE_TYPES.TSUnionType) {
4407
+ if (node.type === import_utils66.AST_NODE_TYPES.TSUnionType) {
4237
4408
  return node.types.some((type) => hasInlineObjectType(type));
4238
4409
  }
4239
4410
  return false;
@@ -4246,7 +4417,7 @@ var preferInterfaceOverInlineTypes = createRule53({
4246
4417
  return;
4247
4418
  }
4248
4419
  const param = node.params[0];
4249
- if (param.type === import_utils62.AST_NODE_TYPES.Identifier && param.typeAnnotation) {
4420
+ if (param.type === import_utils66.AST_NODE_TYPES.Identifier && param.typeAnnotation) {
4250
4421
  const { typeAnnotation } = param.typeAnnotation;
4251
4422
  if (isInlineTypeAnnotation(typeAnnotation) && hasInlineObjectType(typeAnnotation)) {
4252
4423
  context.report({
@@ -4266,11 +4437,11 @@ var preferInterfaceOverInlineTypes = createRule53({
4266
4437
  var prefer_interface_over_inline_types_default = preferInterfaceOverInlineTypes;
4267
4438
 
4268
4439
  // src/rules/prefer-jsx-template-literals.ts
4269
- var import_utils63 = require("@typescript-eslint/utils");
4270
- var createRule54 = import_utils63.ESLintUtils.RuleCreator(
4440
+ var import_utils67 = require("@typescript-eslint/utils");
4441
+ var createRule58 = import_utils67.ESLintUtils.RuleCreator(
4271
4442
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4272
4443
  );
4273
- var preferJSXTemplateLiterals = createRule54({
4444
+ var preferJSXTemplateLiterals = createRule58({
4274
4445
  name: "prefer-jsx-template-literals",
4275
4446
  meta: {
4276
4447
  type: "suggestion",
@@ -4339,9 +4510,9 @@ var preferJSXTemplateLiterals = createRule54({
4339
4510
  if (!child || !nextChild) {
4340
4511
  return;
4341
4512
  }
4342
- if (child.type === import_utils63.AST_NODE_TYPES.JSXText && nextChild.type === import_utils63.AST_NODE_TYPES.JSXExpressionContainer) {
4513
+ if (child.type === import_utils67.AST_NODE_TYPES.JSXText && nextChild.type === import_utils67.AST_NODE_TYPES.JSXExpressionContainer) {
4343
4514
  handleTextBeforeExpression(child, nextChild);
4344
- } else if (child.type === import_utils63.AST_NODE_TYPES.JSXExpressionContainer && nextChild.type === import_utils63.AST_NODE_TYPES.JSXText) {
4515
+ } else if (child.type === import_utils67.AST_NODE_TYPES.JSXExpressionContainer && nextChild.type === import_utils67.AST_NODE_TYPES.JSXText) {
4345
4516
  handleExpressionBeforeText(child, nextChild);
4346
4517
  }
4347
4518
  }
@@ -4354,32 +4525,32 @@ var preferJSXTemplateLiterals = createRule54({
4354
4525
  var prefer_jsx_template_literals_default = preferJSXTemplateLiterals;
4355
4526
 
4356
4527
  // src/rules/prefer-named-param-types.ts
4357
- var import_utils64 = require("@typescript-eslint/utils");
4358
- var createRule55 = import_utils64.ESLintUtils.RuleCreator(
4528
+ var import_utils68 = require("@typescript-eslint/utils");
4529
+ var createRule59 = import_utils68.ESLintUtils.RuleCreator(
4359
4530
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4360
4531
  );
4361
4532
  var returnsJsx2 = (node) => {
4362
- if (node.type === import_utils64.AST_NODE_TYPES.JSXElement || node.type === import_utils64.AST_NODE_TYPES.JSXFragment) {
4533
+ if (node.type === import_utils68.AST_NODE_TYPES.JSXElement || node.type === import_utils68.AST_NODE_TYPES.JSXFragment) {
4363
4534
  return true;
4364
4535
  }
4365
- if (node.type === import_utils64.AST_NODE_TYPES.ConditionalExpression) {
4536
+ if (node.type === import_utils68.AST_NODE_TYPES.ConditionalExpression) {
4366
4537
  return returnsJsx2(node.consequent) || returnsJsx2(node.alternate);
4367
4538
  }
4368
- if (node.type === import_utils64.AST_NODE_TYPES.LogicalExpression) {
4539
+ if (node.type === import_utils68.AST_NODE_TYPES.LogicalExpression) {
4369
4540
  return returnsJsx2(node.left) || returnsJsx2(node.right);
4370
4541
  }
4371
4542
  return false;
4372
4543
  };
4373
4544
  var bodyReturnsJsx2 = (body) => {
4374
- if (body.type !== import_utils64.AST_NODE_TYPES.BlockStatement) {
4545
+ if (body.type !== import_utils68.AST_NODE_TYPES.BlockStatement) {
4375
4546
  return returnsJsx2(body);
4376
4547
  }
4377
4548
  return body.body.some(
4378
- (stmt) => stmt.type === import_utils64.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && returnsJsx2(stmt.argument)
4549
+ (stmt) => stmt.type === import_utils68.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && returnsJsx2(stmt.argument)
4379
4550
  );
4380
4551
  };
4381
4552
  var isReactComponentFunction = (node) => bodyReturnsJsx2(node.body);
4382
- var preferNamedParamTypes = createRule55({
4553
+ var preferNamedParamTypes = createRule59({
4383
4554
  name: "prefer-named-param-types",
4384
4555
  meta: {
4385
4556
  type: "suggestion",
@@ -4394,16 +4565,16 @@ var preferNamedParamTypes = createRule55({
4394
4565
  defaultOptions: [],
4395
4566
  create(context) {
4396
4567
  function hasInlineObjectType(param) {
4397
- if (param.type === import_utils64.AST_NODE_TYPES.AssignmentPattern) {
4568
+ if (param.type === import_utils68.AST_NODE_TYPES.AssignmentPattern) {
4398
4569
  return hasInlineObjectType(param.left);
4399
4570
  }
4400
- if (param.type === import_utils64.AST_NODE_TYPES.ObjectPattern) {
4401
- if (param.typeAnnotation?.typeAnnotation.type === import_utils64.AST_NODE_TYPES.TSTypeLiteral) {
4571
+ if (param.type === import_utils68.AST_NODE_TYPES.ObjectPattern) {
4572
+ if (param.typeAnnotation?.typeAnnotation.type === import_utils68.AST_NODE_TYPES.TSTypeLiteral) {
4402
4573
  return true;
4403
4574
  }
4404
4575
  }
4405
- if (param.type === import_utils64.AST_NODE_TYPES.Identifier) {
4406
- if (param.typeAnnotation?.typeAnnotation.type === import_utils64.AST_NODE_TYPES.TSTypeLiteral) {
4576
+ if (param.type === import_utils68.AST_NODE_TYPES.Identifier) {
4577
+ if (param.typeAnnotation?.typeAnnotation.type === import_utils68.AST_NODE_TYPES.TSTypeLiteral) {
4407
4578
  return true;
4408
4579
  }
4409
4580
  }
@@ -4416,7 +4587,7 @@ var preferNamedParamTypes = createRule55({
4416
4587
  } else if ("value" in node && node.value) {
4417
4588
  params = node.value.params;
4418
4589
  }
4419
- if ((node.type === import_utils64.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils64.AST_NODE_TYPES.FunctionExpression || node.type === import_utils64.AST_NODE_TYPES.ArrowFunctionExpression) && params.length === 1 && params[0].type === import_utils64.AST_NODE_TYPES.Identifier && isReactComponentFunction(node)) {
4590
+ if ((node.type === import_utils68.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils68.AST_NODE_TYPES.FunctionExpression || node.type === import_utils68.AST_NODE_TYPES.ArrowFunctionExpression) && params.length === 1 && params[0].type === import_utils68.AST_NODE_TYPES.Identifier && isReactComponentFunction(node)) {
4420
4591
  return;
4421
4592
  }
4422
4593
  params.forEach((param) => {
@@ -4440,11 +4611,11 @@ var preferNamedParamTypes = createRule55({
4440
4611
  var prefer_named_param_types_default = preferNamedParamTypes;
4441
4612
 
4442
4613
  // src/rules/prefer-props-with-children.ts
4443
- var import_utils65 = require("@typescript-eslint/utils");
4444
- var createRule56 = import_utils65.ESLintUtils.RuleCreator(
4614
+ var import_utils69 = require("@typescript-eslint/utils");
4615
+ var createRule60 = import_utils69.ESLintUtils.RuleCreator(
4445
4616
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4446
4617
  );
4447
- var preferPropsWithChildren = createRule56({
4618
+ var preferPropsWithChildren = createRule60({
4448
4619
  name: "prefer-props-with-children",
4449
4620
  meta: {
4450
4621
  type: "suggestion",
@@ -4462,24 +4633,24 @@ var preferPropsWithChildren = createRule56({
4462
4633
  if (!typeNode) {
4463
4634
  return false;
4464
4635
  }
4465
- if (typeNode.type !== import_utils65.AST_NODE_TYPES.TSTypeReference) {
4636
+ if (typeNode.type !== import_utils69.AST_NODE_TYPES.TSTypeReference) {
4466
4637
  return false;
4467
4638
  }
4468
4639
  const { typeName } = typeNode;
4469
- if (typeName.type === import_utils65.AST_NODE_TYPES.Identifier) {
4640
+ if (typeName.type === import_utils69.AST_NODE_TYPES.Identifier) {
4470
4641
  return typeName.name === "ReactNode";
4471
4642
  }
4472
- if (typeName.type === import_utils65.AST_NODE_TYPES.TSQualifiedName && typeName.left.type === import_utils65.AST_NODE_TYPES.Identifier && typeName.left.name === "React" && typeName.right.type === import_utils65.AST_NODE_TYPES.Identifier && typeName.right.name === "ReactNode") {
4643
+ if (typeName.type === import_utils69.AST_NODE_TYPES.TSQualifiedName && typeName.left.type === import_utils69.AST_NODE_TYPES.Identifier && typeName.left.name === "React" && typeName.right.type === import_utils69.AST_NODE_TYPES.Identifier && typeName.right.name === "ReactNode") {
4473
4644
  return true;
4474
4645
  }
4475
4646
  return false;
4476
4647
  }
4477
4648
  function findChildrenReactNode(members) {
4478
4649
  for (const member of members) {
4479
- if (member.type !== import_utils65.AST_NODE_TYPES.TSPropertySignature) {
4650
+ if (member.type !== import_utils69.AST_NODE_TYPES.TSPropertySignature) {
4480
4651
  continue;
4481
4652
  }
4482
- if (member.key.type !== import_utils65.AST_NODE_TYPES.Identifier) {
4653
+ if (member.key.type !== import_utils69.AST_NODE_TYPES.Identifier) {
4483
4654
  continue;
4484
4655
  }
4485
4656
  if (member.key.name !== "children") {
@@ -4519,11 +4690,11 @@ var preferPropsWithChildren = createRule56({
4519
4690
  var prefer_props_with_children_default = preferPropsWithChildren;
4520
4691
 
4521
4692
  // src/rules/prefer-react-import-types.ts
4522
- var import_utils66 = require("@typescript-eslint/utils");
4523
- var createRule57 = import_utils66.ESLintUtils.RuleCreator(
4693
+ var import_utils70 = require("@typescript-eslint/utils");
4694
+ var createRule61 = import_utils70.ESLintUtils.RuleCreator(
4524
4695
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4525
4696
  );
4526
- var preferReactImportTypes = createRule57({
4697
+ var preferReactImportTypes = createRule61({
4527
4698
  name: "prefer-react-import-types",
4528
4699
  meta: {
4529
4700
  type: "suggestion",
@@ -4599,7 +4770,7 @@ var preferReactImportTypes = createRule57({
4599
4770
  ]);
4600
4771
  const allReactExports = /* @__PURE__ */ new Set([...reactTypes, ...reactRuntimeExports]);
4601
4772
  function checkMemberExpression(node) {
4602
- if (node.object.type === import_utils66.AST_NODE_TYPES.Identifier && node.object.name === "React" && node.property.type === import_utils66.AST_NODE_TYPES.Identifier && allReactExports.has(node.property.name)) {
4773
+ if (node.object.type === import_utils70.AST_NODE_TYPES.Identifier && node.object.name === "React" && node.property.type === import_utils70.AST_NODE_TYPES.Identifier && allReactExports.has(node.property.name)) {
4603
4774
  const typeName = node.property.name;
4604
4775
  const isType = reactTypes.has(typeName);
4605
4776
  const importStatement = isType ? `import type { ${typeName} } from "react"` : `import { ${typeName} } from "react"`;
@@ -4616,7 +4787,7 @@ var preferReactImportTypes = createRule57({
4616
4787
  return {
4617
4788
  MemberExpression: checkMemberExpression,
4618
4789
  "TSTypeReference > TSQualifiedName": (node) => {
4619
- if (node.left.type === import_utils66.AST_NODE_TYPES.Identifier && node.left.name === "React" && node.right.type === import_utils66.AST_NODE_TYPES.Identifier && allReactExports.has(node.right.name)) {
4790
+ if (node.left.type === import_utils70.AST_NODE_TYPES.Identifier && node.left.name === "React" && node.right.type === import_utils70.AST_NODE_TYPES.Identifier && allReactExports.has(node.right.name)) {
4620
4791
  const typeName = node.right.name;
4621
4792
  const isType = reactTypes.has(typeName);
4622
4793
  const importStatement = isType ? `import type { ${typeName} } from "react"` : `import { ${typeName} } from "react"`;
@@ -4636,11 +4807,11 @@ var preferReactImportTypes = createRule57({
4636
4807
  var prefer_react_import_types_default = preferReactImportTypes;
4637
4808
 
4638
4809
  // src/rules/react-props-destructure.ts
4639
- var import_utils67 = require("@typescript-eslint/utils");
4640
- var createRule58 = import_utils67.ESLintUtils.RuleCreator(
4810
+ var import_utils71 = require("@typescript-eslint/utils");
4811
+ var createRule62 = import_utils71.ESLintUtils.RuleCreator(
4641
4812
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4642
4813
  );
4643
- var reactPropsDestructure = createRule58({
4814
+ var reactPropsDestructure = createRule62({
4644
4815
  name: "react-props-destructure",
4645
4816
  meta: {
4646
4817
  type: "suggestion",
@@ -4656,29 +4827,29 @@ var reactPropsDestructure = createRule58({
4656
4827
  defaultOptions: [],
4657
4828
  create(context) {
4658
4829
  function hasJSXInConditional(node) {
4659
- return node.consequent.type === import_utils67.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils67.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils67.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils67.AST_NODE_TYPES.JSXFragment;
4830
+ return node.consequent.type === import_utils71.AST_NODE_TYPES.JSXElement || node.consequent.type === import_utils71.AST_NODE_TYPES.JSXFragment || node.alternate.type === import_utils71.AST_NODE_TYPES.JSXElement || node.alternate.type === import_utils71.AST_NODE_TYPES.JSXFragment;
4660
4831
  }
4661
4832
  function hasJSXInLogical(node) {
4662
- return node.right.type === import_utils67.AST_NODE_TYPES.JSXElement || node.right.type === import_utils67.AST_NODE_TYPES.JSXFragment;
4833
+ return node.right.type === import_utils71.AST_NODE_TYPES.JSXElement || node.right.type === import_utils71.AST_NODE_TYPES.JSXFragment;
4663
4834
  }
4664
4835
  function hasJSXReturn(block) {
4665
4836
  return block.body.some((stmt) => {
4666
- if (stmt.type === import_utils67.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
4667
- return stmt.argument.type === import_utils67.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils67.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils67.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils67.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
4837
+ if (stmt.type === import_utils71.AST_NODE_TYPES.ReturnStatement && stmt.argument) {
4838
+ return stmt.argument.type === import_utils71.AST_NODE_TYPES.JSXElement || stmt.argument.type === import_utils71.AST_NODE_TYPES.JSXFragment || stmt.argument.type === import_utils71.AST_NODE_TYPES.ConditionalExpression && hasJSXInConditional(stmt.argument) || stmt.argument.type === import_utils71.AST_NODE_TYPES.LogicalExpression && hasJSXInLogical(stmt.argument);
4668
4839
  }
4669
4840
  return false;
4670
4841
  });
4671
4842
  }
4672
4843
  function isReactComponent2(node) {
4673
- if (node.type === import_utils67.AST_NODE_TYPES.ArrowFunctionExpression) {
4674
- if (node.body.type === import_utils67.AST_NODE_TYPES.JSXElement || node.body.type === import_utils67.AST_NODE_TYPES.JSXFragment) {
4844
+ if (node.type === import_utils71.AST_NODE_TYPES.ArrowFunctionExpression) {
4845
+ if (node.body.type === import_utils71.AST_NODE_TYPES.JSXElement || node.body.type === import_utils71.AST_NODE_TYPES.JSXFragment) {
4675
4846
  return true;
4676
4847
  }
4677
- if (node.body.type === import_utils67.AST_NODE_TYPES.BlockStatement) {
4848
+ if (node.body.type === import_utils71.AST_NODE_TYPES.BlockStatement) {
4678
4849
  return hasJSXReturn(node.body);
4679
4850
  }
4680
- } else if (node.type === import_utils67.AST_NODE_TYPES.FunctionExpression || node.type === import_utils67.AST_NODE_TYPES.FunctionDeclaration) {
4681
- if (node.body && node.body.type === import_utils67.AST_NODE_TYPES.BlockStatement) {
4851
+ } else if (node.type === import_utils71.AST_NODE_TYPES.FunctionExpression || node.type === import_utils71.AST_NODE_TYPES.FunctionDeclaration) {
4852
+ if (node.body && node.body.type === import_utils71.AST_NODE_TYPES.BlockStatement) {
4682
4853
  return hasJSXReturn(node.body);
4683
4854
  }
4684
4855
  }
@@ -4692,9 +4863,9 @@ var reactPropsDestructure = createRule58({
4692
4863
  return;
4693
4864
  }
4694
4865
  const param = node.params[0];
4695
- if (param.type === import_utils67.AST_NODE_TYPES.ObjectPattern) {
4696
- const properties = param.properties.filter((prop) => prop.type === import_utils67.AST_NODE_TYPES.Property).map((prop) => {
4697
- if (prop.key.type === import_utils67.AST_NODE_TYPES.Identifier) {
4866
+ if (param.type === import_utils71.AST_NODE_TYPES.ObjectPattern) {
4867
+ const properties = param.properties.filter((prop) => prop.type === import_utils71.AST_NODE_TYPES.Property).map((prop) => {
4868
+ if (prop.key.type === import_utils71.AST_NODE_TYPES.Identifier) {
4698
4869
  return prop.key.name;
4699
4870
  }
4700
4871
  return null;
@@ -4721,57 +4892,57 @@ var reactPropsDestructure = createRule58({
4721
4892
  var react_props_destructure_default = reactPropsDestructure;
4722
4893
 
4723
4894
  // src/rules/require-explicit-return-type.ts
4724
- var import_utils68 = require("@typescript-eslint/utils");
4725
- var createRule59 = import_utils68.ESLintUtils.RuleCreator(
4895
+ var import_utils72 = require("@typescript-eslint/utils");
4896
+ var createRule63 = import_utils72.ESLintUtils.RuleCreator(
4726
4897
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4727
4898
  );
4728
4899
  var isReactComponent = (node) => {
4729
- if (node.type === import_utils68.AST_NODE_TYPES.ArrowFunctionExpression) {
4900
+ if (node.type === import_utils72.AST_NODE_TYPES.ArrowFunctionExpression) {
4730
4901
  const { parent } = node;
4731
- if (parent?.type === import_utils68.AST_NODE_TYPES.VariableDeclarator) {
4902
+ if (parent?.type === import_utils72.AST_NODE_TYPES.VariableDeclarator) {
4732
4903
  const { id } = parent;
4733
- if (id.type === import_utils68.AST_NODE_TYPES.Identifier) {
4904
+ if (id.type === import_utils72.AST_NODE_TYPES.Identifier) {
4734
4905
  return /^[A-Z]/.test(id.name);
4735
4906
  }
4736
4907
  }
4737
4908
  }
4738
- if (node.type === import_utils68.AST_NODE_TYPES.FunctionDeclaration && node.id) {
4909
+ if (node.type === import_utils72.AST_NODE_TYPES.FunctionDeclaration && node.id) {
4739
4910
  return /^[A-Z]/.test(node.id.name);
4740
4911
  }
4741
4912
  return false;
4742
4913
  };
4743
4914
  var isCallbackFunction = (node) => {
4744
- if (node.type === import_utils68.AST_NODE_TYPES.FunctionDeclaration) {
4915
+ if (node.type === import_utils72.AST_NODE_TYPES.FunctionDeclaration) {
4745
4916
  return false;
4746
4917
  }
4747
4918
  const { parent } = node;
4748
4919
  if (!parent) {
4749
4920
  return false;
4750
4921
  }
4751
- if (parent.type === import_utils68.AST_NODE_TYPES.CallExpression && parent.arguments.includes(node)) {
4922
+ if (parent.type === import_utils72.AST_NODE_TYPES.CallExpression && parent.arguments.includes(node)) {
4752
4923
  return true;
4753
4924
  }
4754
- if (parent.type === import_utils68.AST_NODE_TYPES.Property) {
4925
+ if (parent.type === import_utils72.AST_NODE_TYPES.Property) {
4755
4926
  return true;
4756
4927
  }
4757
- if (parent.type === import_utils68.AST_NODE_TYPES.ArrayExpression) {
4928
+ if (parent.type === import_utils72.AST_NODE_TYPES.ArrayExpression) {
4758
4929
  return true;
4759
4930
  }
4760
4931
  return false;
4761
4932
  };
4762
4933
  var getFunctionName = (node) => {
4763
- if (node.type === import_utils68.AST_NODE_TYPES.FunctionDeclaration && node.id) {
4934
+ if (node.type === import_utils72.AST_NODE_TYPES.FunctionDeclaration && node.id) {
4764
4935
  return node.id.name;
4765
4936
  }
4766
- if (node.type === import_utils68.AST_NODE_TYPES.FunctionExpression && node.id) {
4937
+ if (node.type === import_utils72.AST_NODE_TYPES.FunctionExpression && node.id) {
4767
4938
  return node.id.name;
4768
4939
  }
4769
- if ((node.type === import_utils68.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils68.AST_NODE_TYPES.FunctionExpression) && node.parent?.type === import_utils68.AST_NODE_TYPES.VariableDeclarator && node.parent.id.type === import_utils68.AST_NODE_TYPES.Identifier) {
4940
+ if ((node.type === import_utils72.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils72.AST_NODE_TYPES.FunctionExpression) && node.parent?.type === import_utils72.AST_NODE_TYPES.VariableDeclarator && node.parent.id.type === import_utils72.AST_NODE_TYPES.Identifier) {
4770
4941
  return node.parent.id.name;
4771
4942
  }
4772
4943
  return null;
4773
4944
  };
4774
- var requireExplicitReturnType = createRule59({
4945
+ var requireExplicitReturnType = createRule63({
4775
4946
  name: "require-explicit-return-type",
4776
4947
  meta: {
4777
4948
  type: "suggestion",
@@ -4820,8 +4991,8 @@ var requireExplicitReturnType = createRule59({
4820
4991
  var require_explicit_return_type_default = requireExplicitReturnType;
4821
4992
 
4822
4993
  // src/rules/sort-exports.ts
4823
- var import_utils69 = require("@typescript-eslint/utils");
4824
- var createRule60 = import_utils69.ESLintUtils.RuleCreator(
4994
+ var import_utils73 = require("@typescript-eslint/utils");
4995
+ var createRule64 = import_utils73.ESLintUtils.RuleCreator(
4825
4996
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4826
4997
  );
4827
4998
  var GROUP_NAMES = ["", "external/alias re-export", "relative re-export", "local export"];
@@ -4835,7 +5006,7 @@ function getExportGroup(node) {
4835
5006
  }
4836
5007
  return 1;
4837
5008
  }
4838
- var sortExports = createRule60({
5009
+ var sortExports = createRule64({
4839
5010
  name: "sort-exports",
4840
5011
  meta: {
4841
5012
  type: "suggestion",
@@ -4875,7 +5046,7 @@ var sortExports = createRule60({
4875
5046
  Program(node) {
4876
5047
  const exportGroups = [];
4877
5048
  node.body.forEach((statement) => {
4878
- if (statement.type !== import_utils69.AST_NODE_TYPES.ExportNamedDeclaration || statement.declaration !== null) {
5049
+ if (statement.type !== import_utils73.AST_NODE_TYPES.ExportNamedDeclaration || statement.declaration !== null) {
4879
5050
  if (exportGroups.length > 0) {
4880
5051
  checkOrder(exportGroups);
4881
5052
  exportGroups.length = 0;
@@ -4894,8 +5065,8 @@ var sortExports = createRule60({
4894
5065
  var sort_exports_default = sortExports;
4895
5066
 
4896
5067
  // src/rules/sort-imports.ts
4897
- var import_utils70 = require("@typescript-eslint/utils");
4898
- var createRule61 = import_utils70.ESLintUtils.RuleCreator(
5068
+ var import_utils74 = require("@typescript-eslint/utils");
5069
+ var createRule65 = import_utils74.ESLintUtils.RuleCreator(
4899
5070
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
4900
5071
  );
4901
5072
  var NODE_BUILTINS = /* @__PURE__ */ new Set([
@@ -4962,7 +5133,7 @@ function getImportGroup(node) {
4962
5133
  function isTypeOnlyImport(node) {
4963
5134
  return node.importKind === "type" && node.specifiers.length > 0;
4964
5135
  }
4965
- var sortImports = createRule61({
5136
+ var sortImports = createRule65({
4966
5137
  name: "sort-imports",
4967
5138
  meta: {
4968
5139
  type: "suggestion",
@@ -5006,7 +5177,7 @@ var sortImports = createRule61({
5006
5177
  Program(node) {
5007
5178
  const importGroups = [];
5008
5179
  node.body.forEach((statement) => {
5009
- if (statement.type !== import_utils70.AST_NODE_TYPES.ImportDeclaration) {
5180
+ if (statement.type !== import_utils74.AST_NODE_TYPES.ImportDeclaration) {
5010
5181
  if (importGroups.length > 0) {
5011
5182
  checkOrder(importGroups);
5012
5183
  importGroups.length = 0;
@@ -5028,13 +5199,13 @@ var sortImports = createRule61({
5028
5199
  var sort_imports_default = sortImports;
5029
5200
 
5030
5201
  // src/rules/sort-type-alphabetically.ts
5031
- var import_utils71 = require("@typescript-eslint/utils");
5032
- var createRule62 = import_utils71.ESLintUtils.RuleCreator(
5202
+ var import_utils75 = require("@typescript-eslint/utils");
5203
+ var createRule66 = import_utils75.ESLintUtils.RuleCreator(
5033
5204
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
5034
5205
  );
5035
5206
  function isAlphabeticallySortedWithinGroups(members) {
5036
5207
  const properties = members.filter(
5037
- (member) => member.type === import_utils71.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils71.AST_NODE_TYPES.Identifier
5208
+ (member) => member.type === import_utils75.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils75.AST_NODE_TYPES.Identifier
5038
5209
  );
5039
5210
  if (properties.length < 2) {
5040
5211
  return true;
@@ -5045,7 +5216,7 @@ function isAlphabeticallySortedWithinGroups(members) {
5045
5216
  const isOptionalSorted = optional.every((name, index) => index === 0 || optional[index - 1].localeCompare(name) <= 0);
5046
5217
  return isRequiredSorted && isOptionalSorted;
5047
5218
  }
5048
- var sortTypeAlphabetically = createRule62({
5219
+ var sortTypeAlphabetically = createRule66({
5049
5220
  name: "sort-type-alphabetically",
5050
5221
  meta: {
5051
5222
  type: "suggestion",
@@ -5063,7 +5234,7 @@ var sortTypeAlphabetically = createRule62({
5063
5234
  function fixMembers(fixer, members) {
5064
5235
  const { sourceCode } = context;
5065
5236
  const properties = members.filter(
5066
- (member) => member.type === import_utils71.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils71.AST_NODE_TYPES.Identifier
5237
+ (member) => member.type === import_utils75.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils75.AST_NODE_TYPES.Identifier
5067
5238
  );
5068
5239
  const required = properties.filter((prop) => !prop.optional);
5069
5240
  const optional = properties.filter((prop) => prop.optional);
@@ -5100,7 +5271,7 @@ var sortTypeAlphabetically = createRule62({
5100
5271
  }
5101
5272
  },
5102
5273
  TSTypeAliasDeclaration(node) {
5103
- if (node.typeAnnotation.type !== import_utils71.AST_NODE_TYPES.TSTypeLiteral) {
5274
+ if (node.typeAnnotation.type !== import_utils75.AST_NODE_TYPES.TSTypeLiteral) {
5104
5275
  return;
5105
5276
  }
5106
5277
  const { members } = node.typeAnnotation;
@@ -5120,13 +5291,13 @@ var sortTypeAlphabetically = createRule62({
5120
5291
  var sort_type_alphabetically_default = sortTypeAlphabetically;
5121
5292
 
5122
5293
  // src/rules/sort-type-required-first.ts
5123
- var import_utils72 = require("@typescript-eslint/utils");
5124
- var createRule63 = import_utils72.ESLintUtils.RuleCreator(
5294
+ var import_utils76 = require("@typescript-eslint/utils");
5295
+ var createRule67 = import_utils76.ESLintUtils.RuleCreator(
5125
5296
  (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name.replaceAll("-", "_").toUpperCase()}.md`
5126
5297
  );
5127
5298
  function isRequiredBeforeOptional(members) {
5128
5299
  const properties = members.filter(
5129
- (member) => member.type === import_utils72.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils72.AST_NODE_TYPES.Identifier
5300
+ (member) => member.type === import_utils76.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils76.AST_NODE_TYPES.Identifier
5130
5301
  );
5131
5302
  if (properties.length < 2) {
5132
5303
  return true;
@@ -5137,7 +5308,7 @@ function isRequiredBeforeOptional(members) {
5137
5308
  }
5138
5309
  return properties.slice(firstOptionalIndex).every((prop) => prop.optional);
5139
5310
  }
5140
- var sortTypeRequiredFirst = createRule63({
5311
+ var sortTypeRequiredFirst = createRule67({
5141
5312
  name: "sort-type-required-first",
5142
5313
  meta: {
5143
5314
  type: "suggestion",
@@ -5155,7 +5326,7 @@ var sortTypeRequiredFirst = createRule63({
5155
5326
  function fixMembers(fixer, members) {
5156
5327
  const { sourceCode } = context;
5157
5328
  const properties = members.filter(
5158
- (member) => member.type === import_utils72.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils72.AST_NODE_TYPES.Identifier
5329
+ (member) => member.type === import_utils76.AST_NODE_TYPES.TSPropertySignature && member.key.type === import_utils76.AST_NODE_TYPES.Identifier
5159
5330
  );
5160
5331
  const required = properties.filter((prop) => !prop.optional);
5161
5332
  const optional = properties.filter((prop) => prop.optional);
@@ -5176,7 +5347,7 @@ var sortTypeRequiredFirst = createRule63({
5176
5347
  }
5177
5348
  },
5178
5349
  TSTypeAliasDeclaration(node) {
5179
- if (node.typeAnnotation.type !== import_utils72.AST_NODE_TYPES.TSTypeLiteral) {
5350
+ if (node.typeAnnotation.type !== import_utils76.AST_NODE_TYPES.TSTypeLiteral) {
5180
5351
  return;
5181
5352
  }
5182
5353
  const { members } = node.typeAnnotation;
@@ -5204,12 +5375,14 @@ var rules = {
5204
5375
  "boolean-naming-prefix": boolean_naming_prefix_default,
5205
5376
  "enforce-camel-case": enforce_camel_case_default,
5206
5377
  "enforce-constant-case": enforce_constant_case_default,
5378
+ "enforce-hook-filename": enforce_hook_filename_default,
5207
5379
  "enforce-hook-naming": enforce_hook_naming_default,
5208
5380
  "enforce-property-case": enforce_property_case_default,
5209
5381
  "enforce-props-suffix": enforce_props_suffix_default,
5210
5382
  "enforce-readonly-component-props": enforce_readonly_component_props_default,
5211
5383
  "enforce-render-naming": enforce_render_naming_default,
5212
5384
  "enforce-service-naming": enforce_service_naming_default,
5385
+ "enforce-test-filename": enforce_test_filename_default,
5213
5386
  "enforce-sorted-destructuring": enforce_sorted_destructuring_default,
5214
5387
  "enforce-type-declaration-order": enforce_type_declaration_order_default,
5215
5388
  "index-export-only": index_export_only_default,
@@ -5233,6 +5406,8 @@ var rules = {
5233
5406
  "no-emoji": no_emoji_default,
5234
5407
  "no-env-fallback": no_env_fallback_default,
5235
5408
  "no-ghost-wrapper": no_ghost_wrapper_default,
5409
+ "no-helper-function-in-hook": no_helper_function_in_hook_default,
5410
+ "no-helper-function-in-test": no_helper_function_in_test_default,
5236
5411
  "no-inline-default-export": no_inline_default_export_default,
5237
5412
  "no-inline-nested-object": no_inline_nested_object_default,
5238
5413
  "no-inline-return-properties": no_inline_return_properties_default,
@@ -5273,9 +5448,11 @@ var baseRules = {
5273
5448
  "nextfriday/boolean-naming-prefix": "warn",
5274
5449
  "nextfriday/enforce-camel-case": "warn",
5275
5450
  "nextfriday/enforce-constant-case": "warn",
5451
+ "nextfriday/enforce-hook-filename": "warn",
5276
5452
  "nextfriday/enforce-hook-naming": "warn",
5277
5453
  "nextfriday/enforce-property-case": "warn",
5278
5454
  "nextfriday/enforce-service-naming": "warn",
5455
+ "nextfriday/enforce-test-filename": "warn",
5279
5456
  "nextfriday/enforce-sorted-destructuring": "warn",
5280
5457
  "nextfriday/enforce-type-declaration-order": "warn",
5281
5458
  "nextfriday/index-export-only": "warn",
@@ -5315,9 +5492,11 @@ var baseRecommendedRules = {
5315
5492
  "nextfriday/boolean-naming-prefix": "error",
5316
5493
  "nextfriday/enforce-camel-case": "error",
5317
5494
  "nextfriday/enforce-constant-case": "error",
5495
+ "nextfriday/enforce-hook-filename": "error",
5318
5496
  "nextfriday/enforce-hook-naming": "error",
5319
5497
  "nextfriday/enforce-property-case": "error",
5320
5498
  "nextfriday/enforce-service-naming": "error",
5499
+ "nextfriday/enforce-test-filename": "error",
5321
5500
  "nextfriday/enforce-sorted-destructuring": "error",
5322
5501
  "nextfriday/enforce-type-declaration-order": "error",
5323
5502
  "nextfriday/index-export-only": "error",