Language-tools: svelte-vscode conflicts with prettier@2

Created on 5 May 2020  路  1Comment  路  Source: sveltejs/language-tools

Describe the bug
Projects using prettier@2 + prettier-plugin-svelte for code formatting see different results from running prettier --write vs svelte-vscode + formatOnSave

To Reproduce

<script>
const foo = bar().baz().baf();
</script>

svelte-vscode formats this as:

<script>
    const foo = bar()
        .baz()
        .baf();
</script>

prettier --write formats this as

<script>
    const foo = bar().baz().baf();
</script>

Expected behaviour
Expect the formatting to be consistent.

Ideally, I would expect svelte-vscode to use some instance of prettier installed locally or globally before anything else.

System (please complete the following information):

  • OS: macOS
  • IDE: VSCode
  • Plugin Svelte Beta

Additional context
Looks very much like the svelte-vscode is formatting like prettier@1

bug

Most helpful comment

You are right, currently a hardcoded version of prettier 1.x is used. We will look into making this dynamic / dependent on user's installation, or at least bump to 2.x .

>All comments

You are right, currently a hardcoded version of prettier 1.x is used. We will look into making this dynamic / dependent on user's installation, or at least bump to 2.x .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canadaduane picture canadaduane  路  5Comments

maximedupre picture maximedupre  路  5Comments

johanbissemattsson picture johanbissemattsson  路  4Comments

vatro picture vatro  路  3Comments

PatrickG picture PatrickG  路  3Comments