Description
Info
- Platform: Linux but most likely all
- Vetur version: 0.22.6
- VS Code version: 1.39.2
Problem
If prettier-tslint is selected within vetur.format.defaultFormatter.ts
the options from vetur.format.defaultFormatterOptions
are not used. In addition it's nowhere documented that prettier-tslint
assumes the settings from prettier
like for e.g.:
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true
}
}
The issue is that the options are not passed into the execution of prettier-tslint. Only the default { parser }
is passed in.
vetur/server/src/utils/prettier/index.ts
Lines 71 to 76 in a27c412
It should be the otherway arround, that the { parser }
is the fallback and the specified options are used instead. I've attached my solution below which I've build and loaded into vscode and looks good to me.
If this issue gets acknowledged I will prepare a PR to fix this. In advance I suppose the same issue applies to prettierEslintify.
Solution
const prettierifiedCode = prettierTslint({
prettierOptions: prettierOptions,
text: code,
filePath: fileFsPath,
fallbackPrettierOptions: { parser }
});