In VS Code, When I select Format Document With...
then choose Prettier - Code Formatter
, I get the following error:
Command 'Format Document' resulted in an error (No loader specified for extension ".cjs", so searchPlaces item ".prettierrc.cjs" is invalid)
From what I can gather this has something to do with underlying TypeScript in VS Code not having a loader available for .cjs
files and Prettier searching for prettierrc.cjs
but I can't quite see how that all fits together, or how to work around it.
Has anyone else encountered, found a work around or solved this or a similar issue in VS Code?
I tried disabling the Prettier VS Code extension and enabling it again and that fixed the issue for me.
Credits @NikolajDamLarsen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With