Skip to content

fix: harden TypeScript project and async detection - #713

Open
GDownes wants to merge 2 commits into
peteromallet:mainfrom
GDownes:fix/typescript-project-tsconfig
Open

fix: harden TypeScript project and async detection#713
GDownes wants to merge 2 commits into
peteromallet:mainfrom
GDownes:fix/typescript-project-tsconfig

Conversation

@GDownes

@GDownes GDownes commented Aug 21, 2026

Copy link
Copy Markdown

Problems

  1. Running desloppify scan --path libs/cognito-deploy-contracts in a TypeScript monorepo creates tsconfig.desloppify.json at the repository root with a hard-coded extends: ./tsconfig.app.json. Library projects commonly own tsconfig.json instead, so the unused detector type-checks the wrong project or falls back after a timeout.
  2. The async_no_await smell detector treats the first { in a multiline typed parameter as the function body. It therefore flags async declarations that contain direct await expressions whenever their argument uses an inline object type.

Fixes

  • Locate the nearest owning tsconfig.app.json or tsconfig.json, create the temporary override beside it, and extend that config. If no TypeScript config exists, use the existing source-based fallback directly.
  • Parse the complete parameter list before locating an async declaration body, including multiline inline-object parameters and return types, then inspect the real body for await.
  • Add regression coverage for both defects.

Validation

  • pytest desloppify/languages/typescript/tests/test_ts_unused.py -q — 19 passed
  • pytest desloppify/languages/typescript/tests/ -q — 429 passed
  • Focused async smell helper suite — 89 passed
  • python -m pytest desloppify/tests/ -q — 5651 passed, 153 skipped, 3 unrelated Bash failures
  • The same 3 Bash failures reproduce without these changes
  • Verified against WorkOrderGuard: library-local TypeScript config resolution works, and false async_no_await findings fell from 10 to 0

@GDownes GDownes changed the title fix: use nearest TypeScript config for unused scans fix: harden TypeScript project and async detection Aug 21, 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

Development

Successfully merging this pull request may close these issues.

1 participant