Closed Hawxy closed 1 year ago
Can you try to downgrade @volar-plugins/prettier
version?
@johnsoncodehk I am not sure if the fixes in the line 69-74 can now be removed?
Anyway, I can't build and test due to errors in packages/pug/src/index.ts
and packages/typescript/src/**/*
. Not sure how to build only one package.
@patarapolw Currently it cannot be removed, otherwise, there will be problems with formatting in SFC. But it should be removed, I'll see how to refactor the implementation.
You can run npx tsc -b -p packages/prettier/tsconfig.build.json
. I will update the related setup.
Please try updating Volar to 1.1.0 and updating @volar-plugins/prettier
to 1.2.0.
@johnsoncodehk Hmmm, v1.2.0 fixes the newline issue but now component props get split across a few lines instead of stacking:
I guess this is the expected behavior of prettier, @patarapolw what do you think?
It isn't, the original is the correct output. Here's a replica in the prettier sandbox.
Can you show your volar.config.js?
The code of the plugin is simple, maybe you can see if it enlightens you: https://github.com/volarjs/plugins/blob/master/packages/prettier/src/index.ts
Ah, it seems that the import changed, I was using const { volarPrettierPlugin } = require('@volar-plugins/prettier');
, I updated it to const volarPrettierPlugin = require('@volar-plugins/prettier');
and we're back in action.
@johnsoncodehk
I have exact same issue as @Hawxy showed in the screenshot above where props stopped being stacked vertically after the update.
I am also using the new volar-service-prettier
package name and config, here's what I have:
Volar extension 1.8.2
package.json:
{
"devDependencies": {
"volar-service-prettier": "^0.0.8"
}
}
volar.config.js:
module.exports = {
plugins: [
require("volar-service-prettier").default({
languages: ["html", "css", "scss", "typescript", "javascript"],
html: {
breakContentsFromTags: false,
},
ignoreIdeOptions: true,
}),
],
};
Any ideas?
I downgraded back to my original setup with @volar-plugins/prettier@1.1.5
and Volar 1.0.24 and it's back to the expected behavior.
Hello, Per the title, I noticed that the prettier plugin adds a newline at the top of files. Could we get an option to disable this? It's not standard behavior for prettier.
Thanks