Closed ImPrankster closed 3 weeks ago
I ran into the same issue and had to create a .prettierignore
to be able to work on the templates, I can open a PR which adds this in
Yea this sucks - I've always just save without formatting
when updating this file but it's not the best.
I may have come up with a better solution. Since the template files are valid JS and JSON we can tell prettier to treat them as JS or JSON, this way we get full prettier support in the files. I expect this would break if you had more complex handlebar syntax but should work fine for simple templates.
I may have come up with a better solution. Since the template files are valid JS and JSON we can tell prettier to treat them as JS or JSON, this way we get full prettier support in the files. I expect this would break if you had more complex handlebar syntax but should work fine for simple templates.
I think prettier supports HBS by default now it's just the behavior is not correct so maybe it's a bug on prettier's side
Provide environment information
turbo gen init
failed with error Error - Bad control character in string literal in JSON at position 221. Unable to modify to "" Error - Aborted due to previous action failure. Unable to function to ""It was caused by prettier formats
To
The extra new line after prettier --check . caused the problem. I was able to fix it by adding a .prettierignore file and add *.hbs to prevent formatting. I am using vscode prettier plugin on the newest version.
Describe the bug
turbo gen init
failed with error Error - Bad control character in string literal in JSON at position 221. Unable to modify to "" Error - Aborted due to previous action failure. Unable to function to ""Link to reproduction
https://github.com/ImPrankster/henry-test/blob/main/turbo/generators/templates/package.json.hbs
To reproduce
Create a new repo and edit .hbs file to cause a prettier format.
Additional information
No response