[x] Update the CHANGELOG.md with a summary of your
Closes #3093
In certain cases it may be preferential to have different fallback configuration based on the language of the document, for example, the developer may have a preference towards tabs, but would still be required to use spaces for .yml files.
This pull request adds the option to override Prettier configuration, defined within VSCode's settings.json file, based on a language identifier; we are then able to fulfil the example above with the following configuration:
HTML whitespace sensitivity, prettier.htmlWhitespaceSensitivity
Vue files scripts and style tag indentation, prettier.vueIndentScriptAndStyle
End of line, prettier.endOfLine
Embedded language formatting, prettier.embeddedLanguageFormatting
Single attribute per line, prettier.singleAttributePerLine
Question
I considered a further fallback whereby the editor's configuration could be taken into account for mappable configuration, namely tabs vs spaces and tab sizes, for example:
editor.tabSize -> prettier.tabWidth
editor.insertSpaces -> prettier.useTabs
This would allow a developer to utilize their existing VSCode configuration for some formatting, without requiring additional prettier.* settings to be defined.
I wasn't sure how that change would be received however, so wanted to submit this for review and gather thoughts before making any further changes.
CHANGELOG.md
with a summary of yourCloses #3093
In certain cases it may be preferential to have different fallback configuration based on the language of the document, for example, the developer may have a preference towards tabs, but would still be required to use spaces for
.yml
files.This pull request adds the option to override Prettier configuration, defined within VSCode's
settings.json
file, based on a language identifier; we are then able to fulfil the example above with the following configuration:Language overridable configuration:
prettier.printWidth
prettier.tabWidth
prettier.useTabs
prettier.semi
prettier.singleQuote
prettier.quoteProps
prettier.jsxSingleQuote
prettier.trailingComma
prettier.bracketSpacing
prettier.bracketSameLine
prettier.jsxBracketSameLine
prettier.arrowParens
prettier.requirePragma
prettier.insertPragma
prettier.proseWrap
prettier.htmlWhitespaceSensitivity
prettier.vueIndentScriptAndStyle
prettier.endOfLine
prettier.embeddedLanguageFormatting
prettier.singleAttributePerLine
Question
I considered a further fallback whereby the editor's configuration could be taken into account for mappable configuration, namely tabs vs spaces and tab sizes, for example:
editor.tabSize
->prettier.tabWidth
editor.insertSpaces
->prettier.useTabs
This would allow a developer to utilize their existing VSCode configuration for some formatting, without requiring additional
prettier.*
settings to be defined.I wasn't sure how that change would be received however, so wanted to submit this for review and gather thoughts before making any further changes.