Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--single-quote not working consistently #2031

Closed
felipediogo opened this issue Jun 7, 2017 · 5 comments
Closed

--single-quote not working consistently #2031

felipediogo opened this issue Jun 7, 2017 · 5 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@felipediogo
Copy link

I have a really simple application that converts a numeral to roman. I'm using prettier to format the code, and the single-quote option it's not working consistently, it changes some exceptions message to single-quote and others to double-quote, I'll put screens from before and after formatting.
Before
screenshot from 2017-06-07 15-03-06

After
screenshot from 2017-06-07 15-03-21

This is the line that I'm executing in my packages.json
"prettier": "prettier --write --single-quote \"src/*.js\" "

@SimenB
Copy link
Contributor

SimenB commented Jun 7, 2017

Prettier avoids escaping ' by using double quotes instead. This is by design

@felipediogo
Copy link
Author

I've noticed that it changes to double quotes in the messages that have a single quote as part of the string. ie: It's unknown how to convert the zero number

@felipediogo
Copy link
Author

Is there a workaround to that, so my lint won't get mad at me?

@SimenB
Copy link
Contributor

SimenB commented Jun 7, 2017

You should disable the linting rules that disagrees with prettier. Easiest is just https://github.com/prettier/eslint-config-prettier, but if it's eslint you can set avoidEscape: true (http://eslint.org/docs/rules/quotes#options)

@felipediogo
Copy link
Author

Yeah, thanks I'll use backtick in the config so I'll have the consistency that I'm aiming.

Thanks for the fast reply, closing the issue now.

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants