-
-
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Naming rules | ||
|
||
Rules are: | ||
|
||
* Made of lowercase words separated by hyphens. | ||
* Split into two parts: | ||
* The first describes [what thing](http://apps.workflower.fi/vocabs/css/en) the rule applies to. | ||
* The second describes what the rule is enforcing. | ||
|
||
```js | ||
selector-max-specificity | ||
^ ^ | ||
| | | ||
the thing what the rule is enforcing | ||
``` | ||
|
||
## No | ||
|
||
Most rules *enforce the inclusion or exclusion* of something. | ||
|
||
For example, whether there should or shouldn't be a trailing semicolon at the end of a declaration block: | ||
|
||
* `declaration-block-trailing-semicolon`: `bool` | ||
* `true` - there *must* be a trailing semicolon | ||
* `false` - there *must not* be a trailing semicolon | ||
|
||
If the rule is *disallowing* something use `*-no-*`. | ||
|
||
For example, whether empty rule-sets should be disallowed or not: | ||
|
||
* `rule-set-no-empty`: `bool` | ||
* `true`: rule-sets *must not* be empty | ||
* `false`: rule-sets *can* be empty (equivalent to not turning the rule on) | ||
|
||
In this case it doesn't make sense to enforce that every rule-set *must* be empty. | ||
|
||
## Max | ||
|
||
If the rule is *setting a limit* to something use `*-max-*`. | ||
|
||
For example, specifying the maximum number of digits after the "." in a number | ||
|
||
* `number-max-precision`: `int` | ||
|
||
## 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. | ||
|
||
For example, what whitespace is allowed before a coma and after the operator in a function: | ||
|
||
* `function-coma-before`: `string` | ||
* `function-operator-after`: `string` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :)