Skip to content

Quality: stale root cleanup, import cycle guards, shared API payload types, ESLint rule tests (#1774-#1777) - #1820

Closed
yachamdaniel1-alt wants to merge 1 commit into
Xoulomon:mainfrom
yachamdaniel1-alt:fix/issues-1774-1777
Closed

yachamdaniel1-alt wants to merge 1 commit into
Xoulomon:mainfrom
yachamdaniel1-alt:fix/issues-1774-1777

Conversation

@yachamdaniel1-alt

Copy link
Copy Markdown
Contributor

Closes #1774
Closes #1775
Closes #1776
Closes #1777

Branch: fix/issues-1774-1777 (account: yachamdaniel1-alt)

Summary

#1774 — Remove stale root-level report/PR message files (scope: repo root)

  • Deleted ANALYTICS_CONSOLIDATION_COMPLETION_REPORT.md, PR_MESSAGE_1540-1543.md, PR_MESSAGE_1544-1545-1546.md.
  • Removed stale issue-360 text accidentally prepended to .gitignore.
  • Added regression guard scripts/check-stale-root-files.sh (fails on PR_MESSAGE_*.md / *_REPORT.md at the repo root).
  • Wired the guard into CI in .github/workflows/docs-checks.yml.
  • Added __tests__/cleanup/root-stale-files.test.ts (vitest).

#1775 — Deduplicate shared types into packages/ (scope: packages)

  • Moved the legacy contract API payload types (Role, TransferStatus, Participant/Raw*, Incentive, Material, Waste, WasteTransfer, stats, metrics, ContractError, RawContractPayload) from frontend/src/api/types.ts into packages/types/src/index.ts (as Api*-prefixed interfaces to avoid colliding with the existing camelCase domain types).
  • frontend/src/api/types.ts is now a thin backwards-compatible re-export layer — every original export name and shape is preserved, so no import sites changed.
  • frontend/src/features/transfers/types.ts now re-exports TransferStatus from @scavngr/types instead of duplicating the union.
  • Removed a broken export * from '../constants' (the module does not exist) from frontend/src/api/index.ts.
  • Added frontend/src/api/types.test.ts (7 tests covering enums, payload shapes, ContractError, and the RawContractPayload union).

Backwards-compatibility impact: none — all existing imports from @/api/types and features/transfers/types resolve to identical shapes.

#1776 — Enforce import ordering and no-cycle rules (scope: eslint-rules)

  • Added import/no-cycle (error, ignoreExternal: true), import/no-self-import (error), and import/no-duplicates (error) to frontend/eslint.config.js, indexer/eslint.config.js, and eslint.config.base.js.
  • Added import/order (alphabetical) to indexer/eslint.config.js — the indexer previously had no import-ordering rule (frontend/base use simple-import-sort).
  • Fixed existing violations: 16 import/no-duplicates across 8 frontend files and 22 import/order violations across 16 indexer files (autofix only — import reordering).
  • Verified 0 circular/self-import violations repo-wide.

#1777 — Custom ESLint rules documentation and tests (scope: eslint-rules)

  • Added RuleTester suites using node:test: eslint-rules/__tests__/error-message-format.test.js (10 cases) and eslint-rules/__tests__/no-only-tests.test.js (10 cases).
  • Added root script test:eslint-rules (node --test eslint-rules/__tests__/*.test.js).
  • Added CI workflow .github/workflows/eslint-rules-tests.yml so rule regressions fail fast.
  • Updated eslint-rules/README.md: documented the no-only-tests rule, added a Testing section, and corrected the inaccurate "auto-fixable" claim.
  • Removed the misleading meta.fixable flag from error-message-format (the rule has no fixer).

Verification

  • node --test eslint-rules/__tests__/*.test.js → 20/20 pass.
  • frontend/src/api/types.test.ts → 7/7 pass.
  • ESLint (frontend + indexer): no violations from the newly added rules.
  • Pre-existing failures skipped as instructed: default frontend vitest config (browser provider error), pre-existing lint errors (e.g. indexer/src/stellar/streamer.ts error-message-format), and unrelated frontend lint debt.

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@yachamdaniel1-alt Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Xoulomon Xoulomon closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants