theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

prettier.config.js doesn't load in extension

Open charlespwd opened this issue 1 year ago • 2 comments

Describe the bug When a user has a ESM prettier config (prettier.config.js), the formatter doesn't do anything and logs the error to the "Output > Window" logs. Nothing happens and there's no feedback to the user.

Expected behaviour We support modern prettier configs, or we gracefully handle config errors by using default configuration/error message to user.

Actual behaviour Nothing happens and the logs are in a different log window. It's confusing as hell.

charlespwd avatar Nov 26 '24 14:11 charlespwd

@charlespwd could you add a little more context here? Maybe enough that somebody could pick this up?

graygilmore avatar Jun 05 '25 16:06 graygilmore

IIRC There was an issue loading prettier configs from https://github.com/Shopify/theme-tools/blob/main/packages/vscode-extension/src/node/formatter.ts#L21

Vague recollection. Opening a theme with a prettier.config.js (not .json) should be enough to make Format Document in the extension do nothing at all.

charlespwd avatar Jun 05 '25 17:06 charlespwd