Closed defusioner closed 6 years ago
Hi @defusioner, please can you provide a reproduction of Prettier doing that by default?
Here is my attempt using the official Prettier playground: https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEBDTBeTAHRG2JABoQIAHGAS3WVGwCcWIB3ABVYTWRIA3CHQAmFEhmQAzbABs0cSgCMW2MAGs4MAMrV1dKAHNkMFgFclIURDAz5iyocUsYXNUYC22ewqsArNAAPACE1TW0dbE84ABlDOF9HKnMYalSAJiSrfRYXAWVsZQBPOWgJahZDGAB1MRgAC2QADgAGSkqIRRq1agFKuBdBRMoWOABHczox92wvHyRZP0pFTzpTCys0QyM5OABFcwh4bMoYIrrRRuQMs7U6OR2AYQhPbwEoaBGQc0UAFSK-EWDjgAF9QUA
As you can see the input:
const a = "a"
Produces the output:
const a = "a";
precise-commits
should not be affecting your prettier configuration, nor its defaults.
@JamesHenry well, what do I have:
[TAB][TAB]const a = 'a'
-> const a = "a";
via playground.
Installed Prettier 1.10.1 (configured as external tool in my IDEA), gives:
[TAB][TAB]const a = "a"
-> const a = 'a';
Precise commits during a commit gives me:
if (true){ [TAB][TAB] const a = "a" }
Transformed into:
if (true){ const a = "a"; }
So something seems not to be right.. I have just installed Prettier's 1.10.1 version globally.
I have same versions of prettier in my project and one installed globally.
I think you are confirming above that precise-commits
is indeed behaving as expected with regards to applying prettier (and using its default behaviour). Your playground example and your example with precise-commits
are identical.
It seems like you have potentially set some configuration within your IDE which is overriding prettier's default for the singleQuote
option. It is false
by default, but it seems like you must have set it to true
somewhere.
Not knowing what IDE you are using I can't really help any further, but I would try and find where you have configured the prettier extension you are using as a next step.
As this is not related to precise-commits
I am going to close the issue for now.
Is this normal that the original Prettier run transforms the code:
to
, when
precise-commit
doesn't do it ? ("a"
stays always"a"
and not'a'
).What are another style differences from the original one?