Closed mstade closed 1 year ago
I think generally, the rule looks good. I slightly question whether it is good to enable it by default, at least with color names enabled, as prose that mentions a color name will get a preview, but maybe that is not a worry for most people 🤷🏻.
@gir-bot lgtm
I think we'll just leave it enabled by default. If we get any complaints, we might consider disabling it by default, but I suspect that most people may be fine with it.
I think generally, the rule looks good. I slightly question whether it is good to enable it by default, at least with color names enabled, as prose that mentions a color name will get a preview, but maybe that is not a worry for most people 🤷🏻.
Prose as in comments? I think that's covered by the string.quoted
scope. At least, I'm not seeing any color previews when writing colors in comments, which is good because commenting out colors is a frequent operation when trying things out! 😅
But prose as in quoted strings in the code? That seems like a bit of an edge case, and I'd say the value definitely outweighs that issue. But if not enabled by default, maybe adding it as a helpful tip in the docs?
I think we'll just leave it enabled by default. If we get any complaints, we might consider disabling it by default, but I suspect that most people may be fine with it.
Hah, we seem to have commented at the same time! 😅 Many thanks for the merge!
But prose as in quoted strings in the code? That seems like a bit of an edge case, and I'd say the value definitely outweighs that issue. But if not enabled by default, maybe adding it as a helpful tip in the docs?
Yeah, that is what I was referring to, not comments as the scope clearly excludes them. And that was my conclusion as well. For those that it might bother, I suspect the value outweighs the annoyance.
What's changed, and why?
This adds support for colors embedded in strings in the JavaScript and JSX syntaxes. This greatly helps when developing UI using CSS-in-JS systems such as Stitches or Styled Components. Here's an example of this rule in action:
Related resources
This should take care of #87.