-
Notifications
You must be signed in to change notification settings - Fork 9
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
Upgrading @vue/compiler-sfc to 3.1.x causes lint to fail, tries to add 20 blank lines around the <template> section #20
Comments
Have the same issue . |
Weird. Could not reproduce it when upgrading Could anyone provide a reproduction repo? |
Try this one: https://github.com/ferrykranenburgcw/vue-todo-pwa Use eslint --fix on any |
@meteorlxy you should be able to reproduce it with my Graphite project's repo however this is unfortunately not a minimal reproduction and you may need to install some dependencies (like Rust) for the project to compile, but you may be able to get away with not compiling the project and just linting the frontend part of the codebase located in |
Just an update, I don't seem to be having this problem anymore (with all my dependencies up to date). @ferrykranenburgcw how about you? |
@Keavon what versions are you using? I am using versions (an still having this issue): |
Having the same issue as well. I believe it might be a Windows only issue? Could not recreate on WSL. Can provide more information if someone else requires. Some dev dep locked versions if it's useful:
Dev dependencies from package:
and .eslintrc.js:
Example SFC:
All line endings are CRLF. Let me know if you need any more information to try and help you recreate it! |
Sorry for delay. I'm closing this issue as it seems to be stale. Feel free to report another one with a valid reproduction if the problem still exists. |
Let me preface this by saying that I don't know if this is an issue with this Prettier plugin or with
@vue/compiler-sfc
, but the problem is showing up during linting with errors coming fromprettier-vue/prettier
which I believe is this project, so I am posting it here to start. Hopefully with more expertise, it can either be fixed here or filed as an issue with additional information invuejs/vue-next
.Recently I have upgraded my npm dependencies and my lint (
vue-cli-service lint
via thenpm run lint
script) was failing. I have narrowed it down to@vue/compiler-sfc
causing the failure. That is, I successfully upgraded all my other dependencies, even including"vue": "^3.1.4"
and"eslint-plugin-prettier-vue": "^3.1.0"
and the lint error does not happen, until I upgrade"@vue/compiler-sfc": "^3.0.11"
to"@vue/compiler-sfc": "^3.1.0"
(or^3.1.4
, the current version, but the issue starts with the 3.1 series).Here is the commit in my project which downgrades
@vue/compiler-sfc
to fix the problem. Please let me know what else I can provide to help debug this. Below are the logs.CLI log:
Note: the two error lines copy/pasted above don't show the mangled characters viewed in the console, which seem to be printing over each other:
The debug log file referenced in the last line of the above log:
Because the lint command automatically fixes the files, it ends up adding 20 blank lines (with one level of tab indentation) only in the
App.vue
file after the opening<template>
tag, and another 20 blank lines (without any indentation, so actually blank) right before the closing</template>
tag. Below is the file modified by the bugged linter, exactly the same as the original except for the two added blocks of 20 lines, and I have omitted the<style>
and<script>
tags later in the file which were untouched:The text was updated successfully, but these errors were encountered: