Skip to content

refactor(usage): unify excluded dirs with constants.ts#409

Open
luojiyin1987 wants to merge 1 commit into
OWASP:mainfrom
luojiyin1987:refactor/unify-excluded-dirs
Open

refactor(usage): unify excluded dirs with constants.ts#409
luojiyin1987 wants to merge 1 commit into
OWASP:mainfrom
luojiyin1987:refactor/unify-excluded-dirs

Conversation

@luojiyin1987
Copy link
Copy Markdown

Closes #408

This PR removes the local IGNORED_DIRS duplicate in src/usage/scanner.ts and imports EXCLUDED_DIRS from src/constants.ts instead.

What changed

  • Removed local IGNORED_DIRS set (only covered 5 directories).
  • Imported EXCLUDED_DIRS from constants.ts (covers 11 directories including .next, .turbo, .angular, .nx).
  • Kept the existing hidden-directory guard (!entry.name.startsWith('.')) intact.

Why

  • Fixes a DRY violation where two files maintained separate lists of directories to skip.
  • Reduces unnecessary file traversal during --usage scans in projects using Next.js, Turborepo, Angular, or Nx.

Verification

  • tsc compiles without errors.
  • Existing tests pass.
  • No functional change to the scan logic beyond skipping more known build/output directories.

- Remove local IGNORED_DIRS duplicate in usage/scanner.ts
- Import EXCLUDED_DIRS from constants.ts instead
- Keeps hidden-directory skip (!entry.name.startsWith('.')) intact
- Ensures .next, .turbo, .angular, .nx are also skipped during --usage scan
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.

refactor(usage): unify EXCLUDED_DIRS to avoid duplication

1 participant