pasika 0.10.24 → 0.10.25

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.
@@ -196,6 +196,7 @@ declare const pasikaPlugin: {
196
196
  "guide-section-shape": _eslint_markdown.MarkdownRuleDefinition;
197
197
  "filename-case": eslint.Rule.RuleModule;
198
198
  "import-boundaries": eslint.Rule.RuleModule;
199
+ "import-spacing": eslint.Rule.RuleModule;
199
200
  "named-exports": eslint.Rule.RuleModule;
200
201
  "support-file-placement": eslint.Rule.RuleModule;
201
202
  "support-folder-shape": eslint.Rule.RuleModule;
@@ -587,6 +587,50 @@ var importBoundariesRule = {
587
587
  }
588
588
  };
589
589
 
590
+ // eslint/rules/import-spacing.ts
591
+ var MESSAGE = "Consecutive import declarations must not be separated by a blank line. See docs/next-codebase-guide/rules/exports-and-imports-rule.md";
592
+ function hasBlankLine(text) {
593
+ return /\r?\n[\t ]*\r?\n/u.test(text);
594
+ }
595
+ function removeBlankLines(text) {
596
+ const newline = text.includes("\r\n") ? "\r\n" : "\n";
597
+ return text.replace(/(?:\r?\n[\t ]*){2,}/gu, newline);
598
+ }
599
+ var importSpacingRule = {
600
+ meta: {
601
+ schema: [],
602
+ type: "layout",
603
+ fixable: "whitespace",
604
+ docs: {
605
+ description: "Disallow blank lines between consecutive import declarations."
606
+ }
607
+ },
608
+ create(context) {
609
+ return {
610
+ Program() {
611
+ const statements = context.sourceCode.ast.body;
612
+ for (let index = 1; index < statements.length; index += 1) {
613
+ const previous = statements[index - 1];
614
+ const current = statements[index];
615
+ if (previous?.type !== "ImportDeclaration" || current?.type !== "ImportDeclaration") continue;
616
+ const previousEnd = previous.range?.[1];
617
+ const currentStart = current.range?.[0];
618
+ if (previousEnd === void 0 || currentStart === void 0) continue;
619
+ const gap = context.sourceCode.text.slice(previousEnd, currentStart);
620
+ if (!hasBlankLine(gap)) continue;
621
+ context.report({
622
+ node: current,
623
+ message: MESSAGE,
624
+ fix(fixer) {
625
+ return fixer.replaceTextRange([previousEnd, currentStart], removeBlankLines(gap));
626
+ }
627
+ });
628
+ }
629
+ }
630
+ };
631
+ }
632
+ };
633
+
590
634
  // eslint/rules/no-mixed-concerns.ts
591
635
  var noMixedConcernsRule = {
592
636
  meta: {
@@ -7728,6 +7772,7 @@ var pasikaNextjsAppRules = {
7728
7772
  // Framework-agnostic TypeScript rules.
7729
7773
  "filename-case": filenameCaseRule,
7730
7774
  "import-boundaries": importBoundariesRule,
7775
+ "import-spacing": importSpacingRule,
7731
7776
  "named-exports": namedExportsRule,
7732
7777
  "support-file-placement": supportFilePlacementRule,
7733
7778
  "support-folder-shape": supportFolderShapeRule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.10.24",
3
+ "version": "0.10.25",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",