Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add option to quotemark rule to disallow all quotes #539

Closed
adidahiya opened this issue Aug 1, 2015 · 6 comments
Closed

Add option to quotemark rule to disallow all quotes #539

adidahiya opened this issue Aug 1, 2015 · 6 comments

Comments

@adidahiya
Copy link
Contributor

A valid coding style would be to only use template strings for all strings.

Ideas for the rule option name:

  • none
  • backtick
@adidahiya
Copy link
Contributor Author

the corresponding option in eslint is called "backtick": http://eslint.org/docs/rules/quotes

@OliverJAsh
Copy link
Contributor

Keen to see this! I want to use backticks everywhere instead of single/double quotes. https://ponyfoo.com/articles/template-literals-strictly-better-strings

@slikts
Copy link

slikts commented Feb 22, 2018

Supporting this; using backticks by default has the benefits of not needing to escape quotes and not needing to convert string literals to template literals in case interpolation needs to be used. The current quotemark rule feels backwards in only having options for disallowing backticks.

@ericbf
Copy link
Contributor

ericbf commented Jun 27, 2018

Can someone familiar with this part get a PR up for this? I would (and could) do it, but I don't even know where to start...

@ericbf
Copy link
Contributor

ericbf commented Jul 12, 2018

Took a stab at that PR. @adidahiya or other contributors, could y'all take a look?

johnwiseheart pushed a commit that referenced this issue Jul 19, 2018
This lets users enforce only backtick "`" strings for everywhere that it's permissible. This also simplifies some logic in the preferred quote determination, combining some disparate logic into the nice self-packaged functions.

> See #539
> The corresponding option in eslint is called "backtick": http://eslint.org/docs/rules/quotes
> See https://ponyfoo.com/articles/template-literals-strictly-better-strings
@JoshuaKGoldberg
Copy link
Contributor

Looks like #4029 fixed this! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants