prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Update config resolution for Prettier 3.1.1

Open elieux opened this issue 1 year ago • 2 comments

Fixes #3253.

  • [ ] No tests broken
  • [x] CHANGELOG.md updated
  • [ ] Code is formatted

Currently makes 1 one more test fail ("Test configurations": "it formats custom file extension") and I'll try to investigate why, but I wanted to at least post this for discussion.

The change is to resolve config for the active file not for the workspace directory. Passing the root directory to resolveConfig was broken in Prettier v3.1.1 with no intention of reverting, as reported here: https://github.com/prettier/prettier/issues/15879

elieux avatar Jan 17 '24 22:01 elieux

I found one issue and fixed it and when I tried the *.abc case manually, it started working, but the automated test still fails. Any ideas?

If I only run the config.test.js suite, it doesn't fail. O.O

elieux avatar Jan 18 '24 09:01 elieux

Something else has updated also in prettier where rolling back the VSCode plugin version doesn't work. So I'm unable to format .svelte files.

olafurw avatar Jan 29 '24 08:01 olafurw

Something else has updated also in prettier where rolling back the VSCode plugin version doesn't work. So I'm unable to format .svelte files.

Yep, same here. Fingers crossed for this fix. Pinning prettier to version 3.1.0 fixes it for me currently, but yeah not ideal.

phocks avatar Feb 28 '24 04:02 phocks

I ran into this as well with 3.1.1 and latest 3.2.5. Instead of pinning to 3.1.0 you can add config file setting. See https://github.com/prettier/prettier-vscode/issues/3235#issuecomment-1879640587

ryanb avatar Mar 19 '24 18:03 ryanb

Moved to by https://github.com/prettier/prettier-vscode/pull/3348

ntotten avatar Mar 21 '24 12:03 ntotten