Comments (9)
Have the same issue .
from eslint-plugin-prettier-vue.
Weird. Could not reproduce it when upgrading @vue/compiler-sfc
in currect repo.
Could anyone provide a reproduction repo?
from eslint-plugin-prettier-vue.
Try this one: https://github.com/ferrykranenburgcw/vue-todo-pwa
Use eslint --fix on any .vue
file and it will add 10 blank newlines at the end of the file..
from eslint-plugin-prettier-vue.
@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 /client/web
. I may or may not have time in the coming week or create a more minimal reproduction repo. The important thing to mention is that it's necessary to delete the node_modules
folder between npm install
s after changing the @vue/compiler-sfc
version in package.json
.
from eslint-plugin-prettier-vue.
Just an update, I don't seem to be having this problem anymore (with all my dependencies up to date). @ferrykranenburgcw how about you?
from eslint-plugin-prettier-vue.
@Keavon what versions are you using? I am using versions (an still having this issue):
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier-vue": "^3.1.0",
"eslint-plugin-vue": "^7.18.0",
"prettier": "^2.4.1"
}
from eslint-plugin-prettier-vue.
@AndreiLevitski https://github.com/GraphiteEditor/Graphite/blob/master/frontend/package.json
from eslint-plugin-prettier-vue.
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:
- @vue/compiler-sfc: "3.2.19"
- eslint-plugin-prettier-vue: "3.1.0"
Dev dependencies from package:
"@openapitools/openapi-generator-cli": "^2.4.1",
"@types/body-scroll-lock": "^3.1.0",
"@types/eslint": "^7.28.1",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@vitejs/plugin-vue": "^1.6.0",
"@vue/compiler-sfc": "^3.2.9",
"@vue/eslint-config-typescript": "^7.0.0",
"autoprefixer": "^10.3.7",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier-vue": "^3.1.0",
"eslint-plugin-vue": "^7.17.0",
"naive-ui": "^2.17.2",
"postcss": "^8.3.11",
"prettier": "^2.3.2",
"tailwindcss": "^2.2.17",
"typescript": "^4.4.2",
"vite": "^2.5.2",
"vite-plugin-eslint": "^1.3.0",
"vue-tsc": "^0.28.4"
}
and .eslintrc.js:
module.exports = {
env: {
node: true,
},
root: true,
extends: [
'plugin:prettier-vue/recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
'prettier',
],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'prettier-vue/prettier': [
'error',
{
printWidth: 100,
singleQuote: true,
semi: false,
trailingComma: 'es5',
endOfLine: 'auto'
},
],
"linebreak-style": ["error", (process.platform === "win32" ? "windows" : "unix")], // assumes you are using autocrlf
},
// Methods added in vue 3 that are now global and dont require imports
globals:{
defineProps:'readonly',
withDefaults:'readonly',
defineEmits: 'readonly'
}
}
Example SFC:
<script setup lang="ts">
import { computed } from 'vue'
import { useStore } from '@/store'
const store = useStore()
const name = computed(() => store.state.oidc.name)
</script>
<template>
<div>
<p>Hello {{ name }}</p>
</div>
</template>
All line endings are CRLF. Let me know if you need any more information to try and help you recreate it!
from eslint-plugin-prettier-vue.
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.
from eslint-plugin-prettier-vue.
Related Issues (19)
- Deletes style tag iteratively HOT 2
- Failed to load plugin 'prettier-vue' declared in '.eslintrc.js': HOT 7
- prettier 'vueIndentScriptAndStyle=true' doesnt work HOT 7
- Issues with end of line for Vue SFC blocks with CLRF/LF HOT 5
- Consider making `eslint-config-prettier` optional dependency. HOT 1
- self-closing rule not working HOT 2
- Overriding "prettier-vue/prettier" as "error" breaks Vite HOT 1
- How can I change all error to warning? HOT 2
- Plugin hides actual ESLint rule involved HOT 1
- Fixing a .vue file inserts nine blank lines If endofline is set to 'crlf' or 'auto'
- Support Typescript 3.7 HOT 1
- Possibility to transfer it nicely when using tailwindcss HOT 1
- Prettier 3.0 is out HOT 1
- Tab settings ignored HOT 1
- Maintenance: merger into the upstream HOT 2
- Problem with eslint `space-before-function-paren` rule in .js files HOT 1
- prettier 2.0 is out HOT 6
- Parsing error: '=' expected HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-prettier-vue.