Different behaviour to Prettier 2.0
See original GitHub issueSummary
Using the latest Prettier 2.0 CLI produces different formatting to the vscode extension even when using identical settings.
prettier-vscode extension:
const isPlayer = R.compose(
equal(player),
nameGet
)
running prettier 2.0.0 on the code from the CLI (npx prettier@2.0.0 --write --no-semi "**/*.js"
):
const isPlayer = R.compose(equal(player), nameGet)
Both are using the same print width setting (80). The only setting active that differs from the default is semi: false.
Steps To Reproduce:
- Download the Prettier vscode extension and set the semi-colon option to false
- Format the following code
const isPlayer = R.compose(equal(player), nameGet)
Expected result
The expected result is that it doesn’t change the code, as running prettier 2.0.0 via the CLI on this code does not change it.
Actual result
It breaks out the code onto multiple lines.
Additional information
Feel free to attach a screenshot.
Extension version: 4.1.1 VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:34:57.037Z) OS version: Darwin x64 19.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
I’m also seeing an issue with the recent release (v4.2.0) of the VS code plugin regarding trailing commas being removed when I format a file on save. I fixed my issue by downgrading to release (v4.1.1).
Should be fixed in v4.4.0.