I had run prettier on a repo I'm working on before with the below options:
# Options (if any):
--single-quote --print-width=80
Now suddenly even though my options haven't changed, the code is getting reformatted again (I have it on save in VSCode). I thought it could be a problem with the VSCode extension, but running:
prettier C:\path\to\file --write --single-quote --print-width=80
Also reformats the file again, mainly cutting previously 'fine' lines into separate lines.
Note: In the playground it outputs the expected code.
Note: This only happens with prettier >1.9.0
Input:
hasSubcategories =
category.subcategories && category.subcategories.length !== 0;
Output:
hasSubcategories =
category.subcategories &&
category.subcategories.length !== 0;
Expected behavior:
hasSubcategories =
category.subcategories && category.subcategories.length !== 0;
I had run prettier on a repo I'm working on before with the below options:
# Options (if any): --single-quote --print-width=80Now suddenly even though my options haven't changed, the code is getting reformatted again (I have it on save in VSCode). I thought it could be a problem with the VSCode extension, but running:
Also reformats the file again, mainly cutting previously 'fine' lines into separate lines.
Note: In the playground it outputs the expected code.
Note: This only happens with prettier >1.9.0
Input:
Output:
Expected behavior: