deseperate to have just a semicolon automaticly at end of line, try all and NEVER happened!!!!
Michael Rutter
@m-rutter
is there a way to get prettier to print the source of its configuaration based on default resolution?
finding prettier is formatting very differently from the default (what we use), and running --no-conifg fixes the result to be what is expected
Jed Fox
@j-f1
prettier --find-config-path ./my/file.js
Michael Rutter
@m-rutter
ok, so is there a reason why
prettier --write src and prettier --write src --no-config would produce different results when prettier --find-config-path src returns nothing
Jed Fox
@j-f1
Can you try prettier --find-config-path on a path to a specific file? I’m not sure if it supports working with directories.
Michael Rutter
@m-rutter
nothing
because I don't have a config file in the project
Jed Fox
@j-f1
huh, that’s weird
Michael Rutter
@m-rutter
we have never had one
but suddenly we are getting lots more noise in our commits from prettier
Jed Fox
@j-f1
I usually make a config file containing just {} to tell editor integrations I’m using Prettier and to make sure there aren’t any other configs being taken into account
Michael Rutter
@m-rutter
and investagating I've found that --no-config produces the result we had previously
investigating*
that does not appear to make a difference
adding a prettierrc file with {}
it reports that that file is the config file
but --no-config produces a completely different result
--no-config only changes the files we have worked on in the last 3 weeks, but without it all of our files get formatted differently
Jed Fox
@j-f1
ok, another thing you can check is node -p 'require("prettier").resolveConfig.sync("./src")' which will print out the config it thinks it’s seeing
and if I take one of the file that have been formatted without the --no-config flag
and paste it into the online editor on the website
it formats it as if it were --no-config
I'm very confused
Jed Fox
@j-f1
Huh. I’m not very active in Prettier anymore and I’m also very confused. Can you open an issue so the other maintainers can take a look? If you can, it would be great to include an example of what’s being changed.
Michael Rutter
@m-rutter
because it seems like the reported config location and printed config are not the one used at all
the only thing I can say that has changed, is we have introduced yarn workspaces and lerna
but I've looked inside of node_modules/.bin and and node_modules/prettier and it all appears to be 2.1.2
Michael Rutter
@m-rutter
so interestingly, if I add an explict {"printWidth": 80} to my config file
it now does what --no-config does
something somewhere is making the default higher than 80
Jed Fox
@j-f1
the only thing I can think of that would cause that is a .editorconfig file with a max_line_length configured
Michael Rutter
@m-rutter
dammit! that is going to be it
my CTO added a .editorconfig a while ago
aahhhhhhhhhhh
I kinda thought it was pointless because we use prettier and other formatters everywhere
Jed Fox
@j-f1
Yay, glad you got it figured out!
Michael Rutter
@m-rutter
yep, he set it to 100
I guess that is a feature request
have something that lets you know its reading an .editorconfig file
prettier --config-sources
Jed Fox
@j-f1
That’s definitely a bug — we should be returning .editorconfig files when you run prettier --find-config-path
Korhan
@Lapin
Hello, I'm building a side with based on gatsby's blog starter boiler plate. But when I try to format my jsx code (within js file) with prettier the language automatically switches to vanilla javascript. Is there any way to not to switch to vanilla javascript it? I have to switch back to jsx everytime :(