-
-
Notifications
You must be signed in to change notification settings - Fork 195
"error Delete ⏎
prettier/prettier" in .vue files
#114
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
Comments
Updating all related packages does not resolve the issue. package.json now looks like this:
|
Hi @ImreC, I am not able to reproduce this issue. Can you please provide an example vue file that exhibits this issue or a set of example steps to recreate the issue. The following steps work for me on a mac. Do they work for you?
? Project name nuxt-app
|
Same issue here on a fresh setup with create-nuxt-app ? Project name foo |
Does running This is only an issue with prettier / eslint-plugin-prettier if the issue persists after running running a prettier command that should fix the reported error |
@BPScott thanks for looking into this and sorry for not testing this earlier. I tried your solution. It increases the amount of errors from 1 to 4. Error output:
|
I had the same issue mentioned in the original post. |
@BPScott thanks for looking into this and sorry for not testing this earlier. I tried your solution. It increases the amount of errors from 1 to 4. Error output: Yep that's what I saw to on my initial run of |
@BPScott I followed your instructions exactly, but I was using npm. I just found out that npm has a different way of passing arguments to scripts than yarn. On npm it is I feel very dumb now, but it's how we learn I guess. Thanks for looking into this! |
The |
This problem exists and has to do with the newlines inserted. Take for example this error:
Then, go to line 36. You will notice a newline between the
If you have this error in another file, just follow the same procedure. |
I have this error but don't have any newline between style and the class and it doesn't go away. |
I had to restart the local server for it to pick up the change. |
@gentunian that did the trick for me ! 👍 |
Thank you for the trick! |
For other's reference, I had a similar, but different error.
Caused by this code...
The complaint? export should not be indented, so highlighting the codeblock and removing 1 indent fixed all the errors (17 in total for default.vue) |
I have encountered this problem in the template section of the vue file and it has now been resolved. Let's share how I used eslint and perttier in the vue project. This is my .eslintrc.js module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
es6: true,
node: true
},
extends: [
'standard',
'plugin:vue/recommended',
'prettier',
'prettier/standard',
'prettier/vue'
],
plugins: ['standard', 'vue', 'prettier'],
rules: {
'prettier/prettier': [
'error',
{
htmlWhitespaceSensitivity: 'ignore',
semi: false,
singleQuote: true
}
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'any'
}
}
],
'vue/no-use-v-if-with-v-for': ['off'],
'vue/component-name-in-template-casing': ['off'],
'vue/no-unused-components': ['off'],
eqeqeq: ['off'],
'no-new': ['off']
}
} Because I didn't configure the prettierrc file separately, I put the prettier configuration item in the eslint configuration file. The option to solve the error Delete This is my vetur and eslint configuration in vscode: "prettier.disableLanguages": [],
"prettier.eslintIntegration": true,
"eslint.enable": false,
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
"vetur.format.defaultFormatter.html": "none",
"vetur.format.defaultFormatter.css": "none",
"vetur.format.defaultFormatter.js": "none",
"vetur.format.defaultFormatter.less": "none",
"vetur.format.defaultFormatter.postcss": "none",
"vetur.format.defaultFormatter.scss": "none",
"vetur.format.defaultFormatter.stylus": "none",
"vetur.format.defaultFormatter.ts": "none",
"vetur.validation.template": false, |
|
hi .. i have the same issue with every component i write .. i ask a friend and told me that i should let the last line empty in every file. and it works fine |
I'm going to lock this thread as nothing productive is happening. All recent replies have been variations on the theme "Prettier suggested I make a change, I made the change and then prettier was happy" |
Uh oh!
There was an error while loading. Please reload this page.
I am using the create-nuxt-app to create a nuxt 2.0 application with prettier included. I am running vscode on a windows machine. My package.json looks like this (nothing changed compared to the template):
The error "error Delete
⏎
prettier/prettier" in .vue files" still persists. I tried to search for a solution, but the only thing that I could find was this old issue (#42) which stated that the issue was resolved over a year ago. Guess it's back?The text was updated successfully, but these errors were encountered: