Search code examples
pythonvisual-studio-codeformattingsingle-quotes

In VSCode, how to apply single quotes on python files, not only to typescript, with prettier?


Why is single quotes applied to typescript, but not to python files? I have prettier installed, but when I save a file, the .ts files are automatically formatted and single quotes is applied, but .py files are not. I have in settings.json file this setting:

"prettier.singleQuote": true,

and I see it is applied to angular files, but not to python files.


Solution

  • Because the Prettier extension only supports these languages:

    JavaScript · TypeScript · Flow · JSX · JSON
    CSS · SCSS · Less
    HTML · Vue · Angular
    GraphQL · Markdown · YAML
    

    Does not include python.

    And you can find, if you select Format Document With... in the python file, it will not list the Prettier.