Skip to content

fix(resolution): allow dot-prefixed path alias targets - #1406

Open
amplifierplus wants to merge 1 commit into
colbymchenry:mainfrom
amplifierplus:fix/dot-prefixed-path-alias
Open

fix(resolution): allow dot-prefixed path alias targets#1406
amplifierplus wants to merge 1 commit into
colbymchenry:mainfrom
amplifierplus:fix/dot-prefixed-path-alias

Conversation

@amplifierplus

Copy link
Copy Markdown

Summary

Allow TypeScript/JavaScript path aliases to target valid in-project directories whose names begin with .., such as ..generated.

Problem

applyAliases() used relative.startsWith('..') to reject alias targets outside the project root. That also rejected valid directory names such as ..generated, causing imports through those aliases to remain unresolved.

Fix

Treat only an actual .. path segment as a parent-directory escape. Cross-drive absolute results on Windows remain rejected.

Tests

Added a regression test covering:

  • a valid ..generated/* target
  • a normal src/generated/* target
  • a real ../outside/* escape

Validation:

  • npx vitest run __tests__/resolution.test.ts
  • npm run build

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