-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
Add naming rules doc #13
Conversation
|
||
## Before and after | ||
|
||
If the rule is *specifying what whitespace is allowed* around something then use `*-before/after` and use `coma`, `colon`, `semicolon`, `opening-brace`, `closing-brace`, `opening-parenthesis`, `closing-parenthesis`, `operator` and `range-operator` to identify that something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two m's in comma :)
How about a note regarding single vs multiple line blocks? There was some discussion around that. I actually started a little work yesterday for one such rule, and found the following intuitive:
What do you think? |
Maybe we should look at eslint for that handle single/multilines http://eslint.org/docs/rules/comma-dangle Do you think we should also handle 0,1,2 (disabled, warning, error) ? |
Yeah, ESLint seems to have that pattern of using keywords as options. But I think for a whitespace rule like Sometimes keywords will definitely be the way to go, though. As for 0, 1, 2 --- I think we don't have a use for 0 if we do not intend to have any defaults turned on, right? 1 and 2 I'm pretty indifferent to myself because I always just use 2 :) If somebody really wants 1 and builds it in, that's perfectly fine with me. |
Perhaps, once we've implemented a couple more rules we can refine the options (keywords vs object). I think I'll try to implement In the meantime, I've added a little bit to the doc about consistently using
Same for me. |
For 0,1, 2 I think it can make sense if we implement some defaults (see eslint/eslint#2100 (comment)) |
Also what about "simple" rules like |
It's fine with me to implement some limited defaults. The 1 vs 2 adds some complexity -- how would you envision that playing out? |
I've added a line about simple rules. We've only thought of 3 so far ( |
Phew, that eslint/eslint#2100 is a long read. @MoOx I somehow came away with completely the opposite impression than you though! Not sure how that happened... From how I understood it, they originally started with defaults but now they are trying to undo that for version 1.0.0. as it had caused them a lot of issues. So, if I did understand nzakas' reasoning in that issue correctly then I suggest we do not have any defaults. |
Actually after reading that I'm also thinking in agreement with nzakas and @jeddy3, and would prefer not to have defaults. I would rather have a "preset" that people could turn on, or "recommended defaults that people can choose to use" (as nzakas called it). I myself have been bothered by ESLint defaults in the past, and the thread shows that I'm not alone. (This does bring up that we need to ensure syntax errors caught by PostCSS are registered in a meaningful way, since that's the bare default for running the plugin (with no other configuration).) |
I am ok with no default but with a fast way (like |
Sweet |
Do we merge this ? |
Oh sure. And then we just add to and modify as needed. Great start @jeddy3 . |
Ha, this was harder than I thought! :)
I'm not happy with how I've described the difference between "normal" rules and
*-no-*
rules. Any ideas?