Repository navigation
fix: decode diagnostic file URLs before reading sources - #821
Closed
charan-rathore wants to merge 1 commit into
Closed
charan-rathore wants to merge 1 commit into
charan-rathore wants to merge 1 commit into
Conversation
✅ Deploy Preview for vite-plugin-checker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
Author
|
Closing this since there has been no movement on it. Happy to reopen and pick it back up if there is interest. |
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.
Description
normalizePathsupports diagnostic filenames starting withfile://, but currently removes the prefix without decoding the URL. A filename such asa space.tsbecomesa%20space.ts.readSourcescannot find that file, so its diagnostics are silently dropped. Percent signs, hashes, and non-ASCII names have the same problem.Use Node's
fileURLToPathto convert the URL to a real filesystem path, including percent decoding and platform-specific path handling. Ordinary relative and absolute paths keep their existing behavior.The tests create real files, turn their names into file URLs, normalize them, and read their contents through
readSources. All four encoded-name cases fail before this change and pass after it. A plain-path control checks that literal percent sequences in non-URL filenames are not decoded.This completes the file-URL support discussed in #679; it does not alter the checker command or spawn handling.
Validation: all 46 unit tests, package typecheck, build, and changed-file Biome checks pass. Full repository lint has a pre-existing formatting error in untouched
utils.spec.ts.