-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
linter: no-useless-spread
fixer clobbers code before span in Vue script block
#5913
Comments
@axetroy what happens when you run |
no-useless-spread
fixer clobbers code before span in Vue script block
I tried to reproduce it and found that the file was not fixed through This seems to be because the |
We need to ignore it in IDE as well, or actually fix the root cause. The root cause is the fixer need to be offset by the <script> tag position. |
- fixes #5913 This PR fixes the calculation of spans when dealing with files that have multiple sources and non-zero source start offsets. This is almost always the case for `.vue`, `.astro`, and `.svelte` files. This enables us to correctly apply fixes for these file types both in the CLI with `oxlint` and also in editors like VS Code. https://github.com/user-attachments/assets/2836c8bd-09be-4e59-801d-7c95f8c2491f I'm open to ideas on how to improve testing in this area, as I don't think that we currently have any tests for fixing files end-to-end (beyond what the linter rules check). I did run this locally on the gitlab repository (which is written in Vue) and all of the fixes appeared to be applied correctly.
- fixes #5913 This PR fixes the calculation of spans when dealing with files that have multiple sources and non-zero source start offsets. This is almost always the case for `.vue`, `.astro`, and `.svelte` files. This enables us to correctly apply fixes for these file types both in the CLI with `oxlint` and also in editors like VS Code. https://github.com/user-attachments/assets/2836c8bd-09be-4e59-801d-7c95f8c2491f I'm open to ideas on how to improve testing in this area, as I don't think that we currently have any tests for fixing files end-to-end (beyond what the linter rules check). I did run this locally on the gitlab repository (which is written in Vue) and all of the fixes appeared to be applied correctly.
And here is the fix:
2024-09-20.15.53.53.mov
The text was updated successfully, but these errors were encountered: