For some reason, my format-on-save is giving me different results than when I run the following command:
prettier --write src/pages/file.svelte`
The difference between formats is a new line being inserted with the --write
command. Is there anyway to check why this is happening?
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": true,
"jsxSingleQuote": false,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"singleQuote": false,
"useTabs": true,
"tabWidth": 2,
"printWidth": 120,
"semi": true,
"trailingComma": "all",
"svelteSortOrder": "styles-scripts-markup",
"svelteStrictMode": false,
"svelteBracketNewLine": true,
"svelteAllowShorthand": false,
"plugins": ["./node_modules/prettier-plugin-svelte"]
}
Thanks to @dummdidumm for the answer
Prettier did a breaking change to the library and prettier-plugin-svelte had to work around that in a newer version.
Updating prettier-plugin-svelte
to ^2.4.0
fixed the issue.