Repository navigation
Lint ui @/ imports that app packages cannot resolve - #227
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
packages/uisources are also compiled insidedesktop,mobileandfrontend. In those packages@/*points at the app's ownsrc, and only a whitelist (@/components/*,@/lib/utils, and the api prefixes) is forwarded back to ui/api via tsconfigpathsand vitealias.So a ui import like
@/lib/laterRevealpasses ui's own typecheck, tests and lint, then fails with TS2307 in the app packages — only surfacing in CI typecheck or the Android build (most recently in the Hide Later Items animation PR). Widening the whitelist isn't an option:frontenduses@/lib/*,@/pages/*and@/routerfor its own files.Changes
eslint.config.jsno-restricted-importsrule for non-test files underpackages/ui/srcthat rejects any@/import outside the forwarded prefixes, with a message pointing to relative imports.packages/ui/src/test/**are excluded, since they only run inside the ui package.Result
The mistake is now flagged in the editor and by
pnpm lintinstead of in CI. Existing code already passes; no imports needed changing.Note: CI does not run
pnpm linttoday, so this guard only works locally until a lint step is added.