Closed nbouvrette closed 7 months ago
Seems like a prettier
core bug?
cc @fisker @sosukesuzuki
I'll take a look.
Not bug. Missed plugins
https://github.com/Avansai/next-multilingual/blob/main/example/.prettierrc.yaml
$ npx prettier --find-config-pah example/.env.development
example/.prettierrc.yaml
I just upgraded to Prettier 3.1.0 this morning and got this new error:
When I downgrade to Prettier 3.0.3 the problem dissapears.
@fisker But it seems a regression, what means config resolution changed.
Maybe a bug was fixed accidentally.
Oh, caused by https://github.com/prettier/prettier/pull/15433, in pre-v3.1 we doesn't format that file at all.
And that's a bug you rasied.. https://github.com/prettier/prettier/issues/15079 😄
OK, last thing is that the error message is a bit confusing? It successfully understands that it should use sh
as the parser what means prettier-plugin-sh
is already loaded correctly.
No, the plugin is not loaded, the config file tells prettier to use that parser, https://github.com/Avansai/next-multilingual/blob/c48503df8062304e215919a9ea2f04476d9b253a/example/.prettierrc.yaml#L25
Hah, that makes sense then! Thanks for your explanation! Close due to answered as above then.
Thanks @fisker and @JounQin - I'm not sure why it was working before?
I thought there was some sort of inheritance but maybe this is gone? in any case adding the plugins
section in the example
prettier config seems to solve the issue.
I'm not sure why it was working before?
Oh, caused by https://github.com/prettier/prettier/pull/15433, in pre-v3.1 we doesn't format that file at all.
Please read the conversation carefully.
I think I get it - thanks for looking into this!
I just upgraded to Prettier
3.1.0
this morning and got this new error:[error] Couldn't resolve parser "sh".
When I downgrade to Prettier
3.0.3
the problem dissapears.How to reproduce:
1) Clone
https://github.com/Avansai/next-multilingual
2) Editpackages.json
and set Prettier to version3.1.0
3) runnpm install
4) runnpm test