yarn prettier:write fails with ' was unexpected at this time on Windows
yarn prettier:write
$ prettier --write --config .prettierrc --ignore-path .prettierignore '**/*.ts?(x)'
' was unexpected at this time.
Solution
Change single quotes to escaped double quotes. This is a Windows specific problem described here.
before:
"prettier:check": "prettier --check --config .prettierrc --ignore-path .prettierignore '**/*.ts?(x)'",
"prettier:write": "prettier --write --config .prettierrc --ignore-path .prettierignore '*/*.ts?(x)'",
after:
"prettier:check": "prettier --check --config .prettierrc --ignore-path .prettierignore \"**/*.ts?(x)\"",
"prettier:write": "prettier --write --config .prettierrc --ignore-path .prettierignore \"**/*.ts?(x)\"",
Recent Comments