pasika 0.10.85 → 0.10.87

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.
@@ -164,7 +164,7 @@ var apiContractRule = {
164
164
 
165
165
  // eslint/rules/application-structure.ts
166
166
  import fs2 from "fs";
167
- import path5 from "path";
167
+ import path6 from "path";
168
168
 
169
169
  // eslint/project/ccf.ts
170
170
  import fs from "fs";
@@ -494,264 +494,8 @@ function parseModule(file) {
494
494
  return { file: path3.resolve(file), imports, reexports, exports, namedNumericLiterals };
495
495
  }
496
496
 
497
- // eslint/rules/project-root.ts
498
- import path4 from "path";
499
- function sourceRootOf(context) {
500
- return path4.resolve(context.cwd ?? process.cwd(), "src");
501
- }
502
-
503
- // eslint/rules/application-structure.ts
504
- var MODULE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]);
505
- var ROUTING_FILES = /* @__PURE__ */ new Set([
506
- "default",
507
- "error",
508
- "global-error",
509
- "instrumentation",
510
- "layout",
511
- "loading",
512
- "middleware",
513
- "not-found",
514
- "page",
515
- "route",
516
- "template",
517
- // File conventions Next.js requires to keep their exact names in src/app/
518
- "apple-icon",
519
- "icon",
520
- "manifest",
521
- "opengraph-image",
522
- "robots",
523
- "sitemap",
524
- "twitter-image"
525
- ]);
526
- var EXPECTED_SUPPORT_FOLDER = {
527
- hook: "hooks",
528
- type: "types",
529
- schema: "schemas",
530
- constant: "constants",
531
- function: "utils"
532
- };
533
- function report(context, message) {
534
- return {
535
- Program(node) {
536
- context.report({ node, loc: { line: 1, column: 0 }, message });
537
- }
538
- };
539
- }
540
- function isCodeFile(filename) {
541
- return MODULE_EXTENSIONS.has(path5.extname(filename));
542
- }
543
- function isRootSupportFolder(folder) {
544
- return SUPPORT_FOLDERS.has(folder);
545
- }
546
- function exportedKinds(filename) {
547
- try {
548
- return new Set(parseModule(filename).exports.map((moduleExport) => moduleExport.kind));
549
- } catch {
550
- return /* @__PURE__ */ new Set();
551
- }
552
- }
553
- function expectedSupportFolder(kinds) {
554
- for (const kind of ["component", "hook", "schema", "function", "constant", "type"]) {
555
- if (kinds.has(kind)) return EXPECTED_SUPPORT_FOLDER[kind];
556
- }
557
- return void 0;
558
- }
559
- function mixedSupportKinds(folder, kinds) {
560
- if (folder === "types") return kinds.has("type") && (kinds.has("constant") || kinds.has("schema"));
561
- if (folder === "schemas") return kinds.has("schema") && (kinds.has("constant") || kinds.has("type"));
562
- if (folder === "constants") return kinds.has("constant") && kinds.has("schema");
563
- return false;
564
- }
565
- function configModuleRoot(filename, sourceRoot) {
566
- const segments = segmentsOf(filename, sourceRoot);
567
- if (segments[0] !== "config" || segments.length < 3) return void 0;
568
- return path5.join(sourceRoot, "config", segments[1] ?? "");
569
- }
570
- function componentFolderStart(segments) {
571
- if (segments[0] === "features") return 2;
572
- if (segments[0] === "compositions" || segments[0] === "shared") return 1;
573
- return -1;
574
- }
575
- function hasComponentBarrel(folderPath) {
576
- return hasExactEntry(folderPath, "index.ts");
577
- }
578
- function componentFolderViolation(segments, sourceRoot) {
579
- const start = componentFolderStart(segments);
580
- if (start < 0) return void 0;
581
- for (let depth = segments.length - 2; depth >= start; depth -= 1) {
582
- const folder = segments[depth];
583
- if (!folder || SUPPORT_FOLDERS.has(folder)) continue;
584
- const folderPath = path5.join(sourceRoot, ...segments.slice(0, depth + 1));
585
- const label = `src/${segments.slice(0, depth + 1).join("/")}/`;
586
- if (!hasComponentOwner(folderPath, folder)) {
587
- return `A folder that is not a support folder must be a component folder; add "${folder}.tsx" to ${label} or move its files into a support folder.`;
588
- }
589
- if (!hasComponentBarrel(folderPath)) {
590
- return `A component folder must have an index.ts that named-re-exports its component; add index.ts to ${label}.`;
591
- }
592
- }
593
- return void 0;
594
- }
595
- var applicationStructureRule = {
596
- meta: {
597
- schema: [],
598
- type: "problem",
599
- docs: {
600
- description: "Enforce the repository's application, configuration, and support-folder structure."
601
- }
602
- },
603
- create(context) {
604
- const filename = path5.resolve(context.filename);
605
- const sourceRoot = sourceRootOf(context);
606
- const segments = segmentsOf(filename, sourceRoot);
607
- if (segments.length === 0) return {};
608
- const [topLevel, secondLevel] = segments;
609
- if (topLevel === void 0) return {};
610
- if (segments.length > 1 && topLevel !== "app" && topLevel !== "compositions" && topLevel !== "features" && topLevel !== "shared" && topLevel !== "config" && topLevel !== "locales" && !isRootSupportFolder(topLevel)) {
611
- return report(
612
- context,
613
- `Move this source file under an allowed src/ folder; "src/${topLevel}/" is not part of the application structure.`
614
- );
615
- }
616
- if (topLevel === "features" && segments.length >= 2 && secondLevel !== void 0) {
617
- if (SUPPORT_FOLDERS.has(secondLevel)) {
618
- return report(
619
- context,
620
- `Move this support folder inside a feature folder; "src/features/${secondLevel}/" does not belong to a feature.`
621
- );
622
- }
623
- if (segments.length === 2) {
624
- return report(context, "src/features/ must contain only feature folders, not source files.");
625
- }
626
- }
627
- if (topLevel === "config") {
628
- if (segments.length === 2) {
629
- return report(
630
- context,
631
- "A configuration module must be a src/config/<config-name>/ folder with index.ts as its entry point."
632
- );
633
- }
634
- const moduleRoot = configModuleRoot(filename, sourceRoot);
635
- if (moduleRoot && !fs2.existsSync(path5.join(moduleRoot, "index.ts"))) {
636
- return report(
637
- context,
638
- `Add src/config/${path5.basename(moduleRoot)}/index.ts as the configuration module entry point.`
639
- );
640
- }
641
- if (moduleRoot && segments.length === 3 && path5.basename(filename) !== "index.ts") {
642
- const kinds2 = exportedKinds(filename);
643
- const expected2 = expectedSupportFolder(kinds2);
644
- if (expected2 !== void 0) {
645
- return report(
646
- context,
647
- `Move this configuration support file into src/config/${path5.basename(moduleRoot)}/${expected2}/.`
648
- );
649
- }
650
- }
651
- }
652
- if (topLevel === "app" && isCodeFile(filename)) {
653
- const basename = path5.basename(filename, path5.extname(filename));
654
- const currentFolder2 = path5.basename(path5.dirname(filename));
655
- if (SUPPORT_FOLDERS.has(currentFolder2)) {
656
- return report(
657
- context,
658
- "src/app/ may contain routing files and framework assets, but ordinary components and support files must live outside src/app/."
659
- );
660
- }
661
- if (!ROUTING_FILES.has(basename) && path5.extname(filename) !== ".css") {
662
- return report(
663
- context,
664
- "src/app/ may contain routing files and framework assets, but ordinary components and support files must live outside src/app/."
665
- );
666
- }
667
- if (ROUTING_FILES.has(basename) || path5.extname(filename) === ".css") return {};
668
- }
669
- const currentFolder = path5.basename(path5.dirname(filename));
670
- const kinds = exportedKinds(filename);
671
- const isConfigModuleRoot = topLevel === "config" && segments.length === 3 && path5.basename(filename) === "index.ts";
672
- if (isConfigModuleRoot) return {};
673
- if (!SUPPORT_FOLDERS.has(currentFolder)) {
674
- const expected2 = expectedSupportFolder(kinds);
675
- if (expected2 !== void 0 && segments.length > 2) {
676
- return report(
677
- context,
678
- `Move this file to a ${expected2}/ folder; ${currentFolder}/ is not a recognized support folder.`
679
- );
680
- }
681
- const violation2 = componentFolderViolation(segments, sourceRoot);
682
- if (violation2 !== void 0) return report(context, violation2);
683
- return {};
684
- }
685
- if (kinds.has("component")) {
686
- return report(
687
- context,
688
- `A support folder must not contain a component; move ${path5.basename(filename)} beside ${currentFolder}/.`
689
- );
690
- }
691
- if (mixedSupportKinds(currentFolder, kinds)) {
692
- return report(
693
- context,
694
- `A ${currentFolder}/ folder must not mix unrelated support kinds; keep types, schemas, and constants in their matching folders.`
695
- );
696
- }
697
- const expected = expectedSupportFolder(kinds);
698
- if (expected !== void 0 && expected !== currentFolder) {
699
- return report(
700
- context,
701
- `Move this file to a ${expected}/ folder; ${currentFolder}/ is reserved for ${expected === "utils" ? "utilities" : expected}.`
702
- );
703
- }
704
- const violation = componentFolderViolation(segments, sourceRoot);
705
- if (violation !== void 0) return report(context, violation);
706
- return {};
707
- }
708
- };
709
-
710
- // eslint/rules/cn-helper.ts
711
- var HELPER2 = "cn";
712
- var ENTRY2 = "pasika/cn";
713
- var DOC2 = "docs/pasika-adoption-guide/rules/cn-helper-rule.md";
714
- var DECLARED2 = `A file must not declare its own ${HELPER2}; import it from ${ENTRY2}. See ${DOC2}`;
715
- var IMPORTED2 = `${HELPER2} must be imported from ${ENTRY2}. See ${DOC2}`;
716
- function isNamed2(node, name) {
717
- return node?.type === "Identifier" && node.name === name;
718
- }
719
- var cnHelperRule = {
720
- meta: {
721
- schema: [],
722
- type: "problem",
723
- docs: {
724
- description: `Require ${HELPER2} to be imported from ${ENTRY2} rather than declared in the repository.`
725
- }
726
- },
727
- create(context) {
728
- const checkSource = (node) => {
729
- if (!node.source || node.source.value === ENTRY2) return;
730
- for (const specifier of node.specifiers) {
731
- if (!isNamed2(specifier.local, HELPER2)) continue;
732
- context.report({ node: specifier, message: IMPORTED2 });
733
- }
734
- };
735
- return {
736
- FunctionDeclaration(node) {
737
- if (isNamed2(node.id, HELPER2)) context.report({ node, message: DECLARED2 });
738
- },
739
- VariableDeclarator(node) {
740
- if (isNamed2(node.id.type === "Identifier" ? node.id : null, HELPER2)) {
741
- context.report({ node, message: DECLARED2 });
742
- }
743
- },
744
- ImportDeclaration: checkSource,
745
- ExportNamedDeclaration: checkSource
746
- };
747
- }
748
- };
749
-
750
- // eslint/rules/component-casing.ts
751
- import path7 from "path";
752
-
753
497
  // eslint/rules/component-conventions.ts
754
- import path6 from "path";
498
+ import path4 from "path";
755
499
  import ts2 from "typescript";
756
500
  var isPascalCase2 = (name) => /^[A-Z][A-Za-z0-9]*$/.test(name);
757
501
  var isHookCallName = (name) => /^use[A-Z]/.test(name);
@@ -868,7 +612,7 @@ function componentFromVariable(node) {
868
612
  };
869
613
  }
870
614
  function parseComponentInfo(text, filename, options) {
871
- const sourceFile = ts2.createSourceFile(path6.resolve(filename), text, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TSX);
615
+ const sourceFile = ts2.createSourceFile(path4.resolve(filename), text, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TSX);
872
616
  const components = [];
873
617
  const namedExports = namedExportedLocalNames(sourceFile);
874
618
  for (const statement of sourceFile.statements) {
@@ -892,7 +636,7 @@ function parseComponentInfo(text, filename, options) {
892
636
  return components;
893
637
  }
894
638
  function findJsxReturningDeclarations(text, filename) {
895
- const sourceFile = ts2.createSourceFile(path6.resolve(filename), text, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TSX);
639
+ const sourceFile = ts2.createSourceFile(path4.resolve(filename), text, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TSX);
896
640
  const results = [];
897
641
  const record = (identifier, body) => {
898
642
  if (isHookCallName(identifier.text) || !containsJsx(body)) return;
@@ -996,7 +740,290 @@ function findRenderedComponentMarkerPaths(component) {
996
740
  });
997
741
  }
998
742
 
743
+ // eslint/rules/project-root.ts
744
+ import path5 from "path";
745
+ function sourceRootOf(context) {
746
+ return path5.resolve(context.cwd ?? process.cwd(), "src");
747
+ }
748
+
749
+ // eslint/rules/application-structure.ts
750
+ var MODULE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]);
751
+ var ROUTING_FILES = /* @__PURE__ */ new Set([
752
+ "default",
753
+ "error",
754
+ "global-error",
755
+ "instrumentation",
756
+ "layout",
757
+ "loading",
758
+ "middleware",
759
+ "not-found",
760
+ "page",
761
+ "route",
762
+ "template",
763
+ // File conventions Next.js requires to keep their exact names in src/app/
764
+ "apple-icon",
765
+ "icon",
766
+ "manifest",
767
+ "opengraph-image",
768
+ "robots",
769
+ "sitemap",
770
+ "twitter-image"
771
+ ]);
772
+ var EXPECTED_SUPPORT_FOLDER = {
773
+ hook: "hooks",
774
+ type: "types",
775
+ schema: "schemas",
776
+ constant: "constants",
777
+ function: "utils"
778
+ };
779
+ function report(context, message) {
780
+ return {
781
+ Program(node) {
782
+ context.report({ node, loc: { line: 1, column: 0 }, message });
783
+ }
784
+ };
785
+ }
786
+ function isCodeFile(filename) {
787
+ return MODULE_EXTENSIONS.has(path6.extname(filename));
788
+ }
789
+ function isRootSupportFolder(folder) {
790
+ return SUPPORT_FOLDERS.has(folder);
791
+ }
792
+ function exportedKinds(filename) {
793
+ try {
794
+ return new Set(parseModule(filename).exports.map((moduleExport) => moduleExport.kind));
795
+ } catch {
796
+ return /* @__PURE__ */ new Set();
797
+ }
798
+ }
799
+ function expectedSupportFolder(kinds) {
800
+ for (const kind of ["component", "hook", "schema", "function", "constant", "type"]) {
801
+ if (kinds.has(kind)) return EXPECTED_SUPPORT_FOLDER[kind];
802
+ }
803
+ return void 0;
804
+ }
805
+ function mixedSupportKinds(folder, kinds) {
806
+ if (folder === "types") return kinds.has("type") && (kinds.has("constant") || kinds.has("schema"));
807
+ if (folder === "schemas") return kinds.has("schema") && (kinds.has("constant") || kinds.has("type"));
808
+ if (folder === "constants") return kinds.has("constant") && kinds.has("schema");
809
+ return false;
810
+ }
811
+ function configModuleRoot(filename, sourceRoot) {
812
+ const segments = segmentsOf(filename, sourceRoot);
813
+ if (segments[0] !== "config" || segments.length < 3) return void 0;
814
+ return path6.join(sourceRoot, "config", segments[1] ?? "");
815
+ }
816
+ function componentFolderStart(segments) {
817
+ if (segments[0] === "features") return 2;
818
+ if (segments[0] === "compositions" || segments[0] === "shared") return 1;
819
+ return -1;
820
+ }
821
+ function hasComponentBarrel(folderPath) {
822
+ return hasExactEntry(folderPath, "index.ts");
823
+ }
824
+ function componentFolderViolation(segments, sourceRoot) {
825
+ const start = componentFolderStart(segments);
826
+ if (start < 0) return void 0;
827
+ for (let depth = segments.length - 2; depth >= start; depth -= 1) {
828
+ const folder = segments[depth];
829
+ if (!folder || SUPPORT_FOLDERS.has(folder)) continue;
830
+ const folderPath = path6.join(sourceRoot, ...segments.slice(0, depth + 1));
831
+ const label = `src/${segments.slice(0, depth + 1).join("/")}/`;
832
+ if (!hasComponentOwner(folderPath, folder)) {
833
+ return `A folder that is not a support folder must be a component folder; add "${folder}.tsx" to ${label} or move its files into a support folder.`;
834
+ }
835
+ if (!hasComponentBarrel(folderPath)) {
836
+ return `A component folder must have an index.ts that named-re-exports its component; add index.ts to ${label}.`;
837
+ }
838
+ }
839
+ return void 0;
840
+ }
841
+ function componentFacadeTarget(context, filename) {
842
+ if (path6.extname(filename) !== ".ts" || path6.basename(filename) === "index.ts") return void 0;
843
+ const statements = context.sourceCode.ast.body;
844
+ if (statements.length === 0 || statements.some((node) => node.type !== "ExportNamedDeclaration" || !node.source)) {
845
+ return void 0;
846
+ }
847
+ for (const statement of statements) {
848
+ if (statement.type !== "ExportNamedDeclaration" || typeof statement.source?.value !== "string") continue;
849
+ if (!statement.source.value.startsWith("./")) return void 0;
850
+ const componentFile = path6.resolve(path6.dirname(filename), `${statement.source.value}.tsx`);
851
+ if (!fs2.existsSync(componentFile)) continue;
852
+ const components = parseComponentInfo(fs2.readFileSync(componentFile, "utf8"), componentFile);
853
+ if (components.some(
854
+ ({ name }) => statement.specifiers.some(
855
+ (specifier) => specifier.local.type === "Identifier" && specifier.local.name === name
856
+ )
857
+ )) {
858
+ return componentFile;
859
+ }
860
+ }
861
+ return void 0;
862
+ }
863
+ var applicationStructureRule = {
864
+ meta: {
865
+ schema: [],
866
+ type: "problem",
867
+ docs: {
868
+ description: "Enforce the repository's application, configuration, and support-folder structure."
869
+ }
870
+ },
871
+ create(context) {
872
+ const filename = path6.resolve(context.filename);
873
+ const sourceRoot = sourceRootOf(context);
874
+ const segments = segmentsOf(filename, sourceRoot);
875
+ if (segments.length === 0) return {};
876
+ const componentTarget = componentFacadeTarget(context, filename);
877
+ if (componentTarget) {
878
+ return report(
879
+ context,
880
+ `Avoid a forwarding .ts file for a sibling component: move the implementation from ${path6.basename(componentTarget)} to ${path6.basename(filename, ".ts")}.tsx and remove the .ts facade.`
881
+ );
882
+ }
883
+ const [topLevel, secondLevel] = segments;
884
+ if (topLevel === void 0) return {};
885
+ if (segments.length > 1 && topLevel !== "app" && topLevel !== "compositions" && topLevel !== "features" && topLevel !== "shared" && topLevel !== "config" && topLevel !== "locales" && !isRootSupportFolder(topLevel)) {
886
+ return report(
887
+ context,
888
+ `Move this source file under an allowed src/ folder; "src/${topLevel}/" is not part of the application structure.`
889
+ );
890
+ }
891
+ if (topLevel === "features" && segments.length >= 2 && secondLevel !== void 0) {
892
+ if (SUPPORT_FOLDERS.has(secondLevel)) {
893
+ return report(
894
+ context,
895
+ `Move this support folder inside a feature folder; "src/features/${secondLevel}/" does not belong to a feature.`
896
+ );
897
+ }
898
+ if (segments.length === 2) {
899
+ return report(context, "src/features/ must contain only feature folders, not source files.");
900
+ }
901
+ }
902
+ if (topLevel === "config") {
903
+ if (segments.length === 2) {
904
+ return report(
905
+ context,
906
+ "A configuration module must be a src/config/<config-name>/ folder with index.ts as its entry point."
907
+ );
908
+ }
909
+ const moduleRoot = configModuleRoot(filename, sourceRoot);
910
+ if (moduleRoot && !fs2.existsSync(path6.join(moduleRoot, "index.ts"))) {
911
+ return report(
912
+ context,
913
+ `Add src/config/${path6.basename(moduleRoot)}/index.ts as the configuration module entry point.`
914
+ );
915
+ }
916
+ if (moduleRoot && segments.length === 3 && path6.basename(filename) !== "index.ts") {
917
+ const kinds2 = exportedKinds(filename);
918
+ const expected2 = expectedSupportFolder(kinds2);
919
+ if (expected2 !== void 0) {
920
+ return report(
921
+ context,
922
+ `Move this configuration support file into src/config/${path6.basename(moduleRoot)}/${expected2}/.`
923
+ );
924
+ }
925
+ }
926
+ }
927
+ if (topLevel === "app" && isCodeFile(filename)) {
928
+ const basename = path6.basename(filename, path6.extname(filename));
929
+ const currentFolder2 = path6.basename(path6.dirname(filename));
930
+ if (SUPPORT_FOLDERS.has(currentFolder2)) {
931
+ return report(
932
+ context,
933
+ "src/app/ may contain routing files and framework assets, but ordinary components and support files must live outside src/app/."
934
+ );
935
+ }
936
+ if (!ROUTING_FILES.has(basename) && path6.extname(filename) !== ".css") {
937
+ return report(
938
+ context,
939
+ "src/app/ may contain routing files and framework assets, but ordinary components and support files must live outside src/app/."
940
+ );
941
+ }
942
+ if (ROUTING_FILES.has(basename) || path6.extname(filename) === ".css") return {};
943
+ }
944
+ const currentFolder = path6.basename(path6.dirname(filename));
945
+ const kinds = exportedKinds(filename);
946
+ const isConfigModuleRoot = topLevel === "config" && segments.length === 3 && path6.basename(filename) === "index.ts";
947
+ if (isConfigModuleRoot) return {};
948
+ if (!SUPPORT_FOLDERS.has(currentFolder)) {
949
+ const expected2 = expectedSupportFolder(kinds);
950
+ if (expected2 !== void 0 && segments.length > 2) {
951
+ return report(
952
+ context,
953
+ `Move this file to a ${expected2}/ folder; ${currentFolder}/ is not a recognized support folder.`
954
+ );
955
+ }
956
+ const violation2 = componentFolderViolation(segments, sourceRoot);
957
+ if (violation2 !== void 0) return report(context, violation2);
958
+ return {};
959
+ }
960
+ if (kinds.has("component")) {
961
+ return report(
962
+ context,
963
+ `A support folder must not contain a component; move ${path6.basename(filename)} beside ${currentFolder}/.`
964
+ );
965
+ }
966
+ if (mixedSupportKinds(currentFolder, kinds)) {
967
+ return report(
968
+ context,
969
+ `A ${currentFolder}/ folder must not mix unrelated support kinds; keep types, schemas, and constants in their matching folders.`
970
+ );
971
+ }
972
+ const expected = expectedSupportFolder(kinds);
973
+ if (expected !== void 0 && expected !== currentFolder) {
974
+ return report(
975
+ context,
976
+ `Move this file to a ${expected}/ folder; ${currentFolder}/ is reserved for ${expected === "utils" ? "utilities" : expected}.`
977
+ );
978
+ }
979
+ const violation = componentFolderViolation(segments, sourceRoot);
980
+ if (violation !== void 0) return report(context, violation);
981
+ return {};
982
+ }
983
+ };
984
+
985
+ // eslint/rules/cn-helper.ts
986
+ var HELPER2 = "cn";
987
+ var ENTRY2 = "pasika/cn";
988
+ var DOC2 = "docs/pasika-adoption-guide/rules/cn-helper-rule.md";
989
+ var DECLARED2 = `A file must not declare its own ${HELPER2}; import it from ${ENTRY2}. See ${DOC2}`;
990
+ var IMPORTED2 = `${HELPER2} must be imported from ${ENTRY2}. See ${DOC2}`;
991
+ function isNamed2(node, name) {
992
+ return node?.type === "Identifier" && node.name === name;
993
+ }
994
+ var cnHelperRule = {
995
+ meta: {
996
+ schema: [],
997
+ type: "problem",
998
+ docs: {
999
+ description: `Require ${HELPER2} to be imported from ${ENTRY2} rather than declared in the repository.`
1000
+ }
1001
+ },
1002
+ create(context) {
1003
+ const checkSource = (node) => {
1004
+ if (!node.source || node.source.value === ENTRY2) return;
1005
+ for (const specifier of node.specifiers) {
1006
+ if (!isNamed2(specifier.local, HELPER2)) continue;
1007
+ context.report({ node: specifier, message: IMPORTED2 });
1008
+ }
1009
+ };
1010
+ return {
1011
+ FunctionDeclaration(node) {
1012
+ if (isNamed2(node.id, HELPER2)) context.report({ node, message: DECLARED2 });
1013
+ },
1014
+ VariableDeclarator(node) {
1015
+ if (isNamed2(node.id.type === "Identifier" ? node.id : null, HELPER2)) {
1016
+ context.report({ node, message: DECLARED2 });
1017
+ }
1018
+ },
1019
+ ImportDeclaration: checkSource,
1020
+ ExportNamedDeclaration: checkSource
1021
+ };
1022
+ }
1023
+ };
1024
+
999
1025
  // eslint/rules/component-casing.ts
1026
+ import path7 from "path";
1000
1027
  function isPascalCase3(name) {
1001
1028
  return /^[A-Z][A-Za-z0-9]*$/.test(name);
1002
1029
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.10.85",
3
+ "version": "0.10.87",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",