Add no-double-slash-css-comments rule #675
Conversation
Thanks for working on this, @kangax! Do you think it's comprehensive enough? With a name like If so, it seems that maybe what needs to be done is search through the whole stylesheet string for Then we could add tests checking for |
@kangax : And nice job picking up on all the patterns for defining and testing rules! |
@kangax Thanks for this :)
I believe
So we won't be able to check these locations with the regular parser. We can add another rule, perhaps called Does that make sense, or have a misunderstood things? :) (Marking as "needs revision" for the code style errors) |
@jeddy3 , @kangax : Oh, sorry that must have been part of the original conversation that I somehow missed! What a bonehead. If we're preventing the patterns in that article, then a couple of things:
|
According to astexplorer PostCSS parses at-rules with
Definitely! @kangax Can you make the change please?
@kangax Sorry to flip-flop on this one, but I agree with David. If the rule name confused him that it's very likely to confuse users who aren't familiar with stylelint. Also, using the word "hacks" is used in the companion I think once the following are done, we'll be ready to merge :)
|
Hey folks. So yes, like @jeddy3 mentions, I didn't include I'll add a test for @ rule now and a link to the doc. Good points! As far as name goes... I still believe that "hack" is confusing. In my frontend life (of almost 10 years) I've never thought of The reason I don't think it will be confused with what's targeting by preprocessor is because we used the word CSS (double-slash-css-comments seems pretty explicit). If you're still against it, that's cool. I'm not completely hung up on this; but I do think that it's a reasonable name choice :) |
I get it, yeah ... I would still prefer if we could think of some qualifier that more clearly distinguished this from preprocessor The basic goal in my mind is to cause anybody who doesn't immediately know what this is about to check out the docs before making assumptions. So some less-familiar word or phrase in the name would be nice. How about |
This comment has been minimized.
This comment has been minimized.
davidtheclark
commented on src/rules/no-double-slash-css-comments/__tests__/index.js
in 895e3ca
Feb 2, 2016
Huh, looks like the |
(double negative sucks but...)
|
no-invalid-double-slash-comments (since a validator like the W3C's will reject it) |
Sounds good to me |
Ok. I defer to @jeddy3 on final decisions for naming, so let's see what he thinks. Otherwise, I just have a couple more addition ideas:
|
When you say "preprocessor // single-line comments" what exactly do you mean? Does Sass/SCSS have preprocessor directives via double-slash comments? I don't recall but I guess I'm forgetting something? |
Does this make sense, to you and as part of the documentation?
|
Sgtm. As does your paragraph for the docs :-) |
Excellent! |
Add no-double-slash-css-comments rule
Thanks guys! Looks great :) |
No description provided.