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

Switch to enforcing single quotes #14

Closed
jaydenseric opened this issue Mar 14, 2016 · 7 comments
Closed

Switch to enforcing single quotes #14

jaydenseric opened this issue Mar 14, 2016 · 7 comments
Labels
status: wip is being worked on by someone type: enhancement a new feature that isn't related to rules

Comments

@jaydenseric
Copy link

Single quotes are a better for three main reasons:

  1. Consistency with the most popular PHP and JS style guides (see eslint-config-standard).
  2. Easier to type (no shift key press). This allows faster typing and reduces the risk of RSI.
  3. Visually less noise. Single quotes are a simpler symbol and are cleaner to look at.

Rules to tweak:

  • font-family-name-quotes
  • function-url-quotes
  • string-quotes
@jaydenseric
Copy link
Author

I would seriously consider enforcing no quotes, as it is perfectly valid not to use them and less is more. The only downside is syntax highlighters are often not that smart and usually highlight the strings differently without quotes. I see that as an issue with the highlighters not following W3C specs properly though. It seems stylelint documentation examples do not use quotes, see at-rule-empty-line-before.

@jeddy3
Copy link
Member

jeddy3 commented Mar 15, 2016

@jaydenseric Thanks for the input. You raise some good points.

@davidtheclark I went back through the style guides linked to from the README and found quotes to be more divisive than I originally thought. There isn't any consistency across the style guides. Perhaps we should follow eslint's lead and not specify a quotes config.

@davidtheclark
Copy link
Contributor

I agree that there's no consistent standard, so let's cut it out,

On Mar 15, 2016, at 1:41 AM, Richard Hallows notifications@github.com wrote:

@jaydenseric Thanks for the input. You raise some good points.

I would seriously consider enforcing no quotes

@davidtheclark I went back through the style guides linked to from the README and found quotes to be more divisive than I originally thought. There isn't any consistency across the style guides. Perhaps we should follow eslint's lead and not specify a quotes config.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#14 (comment)

@oliverturner
Copy link

Additionally, I'm finding that the following

  "stylelint": {
    "extends": "stylelint-config-standard",
    "rules": {
      "string-quotes": "single"
    }
  }

creates a Kafkaesque paradox wherein I can only be wrong:

  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

=> Expected double quotes around font-family name "Helvetica Neue" (font-family-name-quotes)

  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

=> Expected single quotes (string-quotes)

@jeddy3
Copy link
Member

jeddy3 commented Mar 27, 2016

@oliverturner This is because each rule is standalone and sometimes it's possible to configure rules so that they conflict with one another. In this instance you're only overriding the string-quotes rule to "single", but font-family-name-quotes is still set to "double-where-recommended" within the config. So, you'll need to override both rules to avoid this paradox.

Going forward, we're going to remove the quote rules and so it'll be less likely someone will run into the issue you've had.

@jeddy3 jeddy3 added status: wip is being worked on by someone type: enhancement a new feature that isn't related to rules and removed status: discussion labels Mar 27, 2016
@jeddy3 jeddy3 closed this as completed in 23baa55 Apr 7, 2016
@santanajames
Copy link

Seems like double quotes were added back for string-quotes in version 23.0.0. Curious about the reasoning behind this given the decision mentioned by @jeddy3.

@jeddy3
Copy link
Member

jeddy3 commented Dec 10, 2021

@santanajames See #198 (comment).

The emphasis of the config changed:

  • from being foundational based on the commonality found in userland style guides
  • to being something complete that helps users author CSS that looks like the examples in the specs (which nearly always use double quotes as far as I can tell)

The conflicts mentioned above were resolved a couple of years ago. The options for rules like font-family-name-quotes were changed to be agnostic of the type of quote.

I would seriously consider enforcing no quotes, as it is perfectly valid not to use them and less is more

Unquoted url functions are now legacy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: enhancement a new feature that isn't related to rules
Development

No branches or pull requests

5 participants