Prettier options for Typescript
ivikash opened this issue Β· comments
Vikash Agrawal commented
Hey, I am trying to use prettier for typescript. By command line I am using --print-width 80 --single-quote --no-semi --no-bracket-spacing --write
. Can you please let me know, how can I replicate this in elisp?
If I try this
(setq prettier-js-args '(
"--print-width" "80"
"--single-quote" "true"
"--no-semi" "true"
"--no-bracket-spacing" "true"
))
I receive the following error.
prettier errors:
Unable to read file: true
Error: ENOENT: no such file or directory, open 'true'
Unable to read file: true
Error: ENOENT: no such file or directory, open 'true'
Vikash Agrawal commented
(setq prettier-js-args '(
"--print-width" "80"
"--single-quote" "true"
"--no-semi"
"--no-bracket-spacing"
))
Works!
Roman Coedo commented
You have an example of this in the README.md
. You can set arguments like this:
(setq prettier-js-args '(
"--trailing-comma" "all"
"--bracket-spacing" "false"
))
Let me know if it is not clear enough so we can fix the readme π
Roman Coedo commented
Oops, looks like I was late! π
I'm glad that you got it working! π
Vikash Agrawal commented
Thanks @rcoedo π