-
-
Notifications
You must be signed in to change notification settings - Fork 721
fix(oxlint): Fix type-aware linting crash when Vue files are present #13007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
--type-aware linting fails when projects contains vue files…of PathBuf Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a crash in the --type-aware linting functionality when Vue files are present in the project. The issue occurred because the type-aware linter was attempting to process all lintable files (including Vue files) through SourceType::from_path(), which only supports JavaScript and TypeScript extensions.
- Added a filter to exclude non-JS/TS files from type-aware processing
- Imported
SourceTypeto enable the filtering functionality - Preserved normal linting behavior for all file types including Vue files
The
--type-awarelinting functionality was crashing when projects contained Vue files. The issue occurred because the tsgolint module was attempting to process all lintable files (including.vuefiles) for type checking, butSourceType::from_path()only supports JavaScript and TypeScript file extensions.Problem
When running
oxlint --type-awareon a project containing Vue files, the program would fail with an error because:.vuefiles (which are inLINTABLE_EXTENSIONS)SourceType::from_path()returns an error for.vuefiles since they're not valid JS/TS extensionsSolution
Added a filter in
tsgolint.rsto only process files that can be handled bySourceType::from_path()(i.e., JavaScript and TypeScript files) before sending them to tsgolint for type checking. Vue files and other non-JS/TS files are now filtered out during type-aware linting while still being processed correctly by the normal linter.The fix is minimal and surgical - only 4 lines added to filter the file paths before processing, ensuring that:
Testing
Fixes #13003.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.