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

Docs: clean up key-spacing docs (fixes #9900) #9963

Merged
merged 4 commits into from Feb 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 12 additions & 8 deletions docs/rules/key-spacing.md
Expand Up @@ -10,14 +10,18 @@ This rule enforces consistent spacing between keys and values in object literal

This rule has an object option:

* `"beforeColon": false` (default) disallows spaces between the key and the colon in object literals.
* `"beforeColon": true` requires at least one space between the key and the colon in object literals.
* `"afterColon": true` (default) requires at least one space between the colon and the value in object literals.
* `"afterColon": false` disallows spaces between the colon and the value in object literals.
* `"mode": "strict"` (default) enforces exactly one space before or after colons in object literals.
* `"mode": "minimum"` enforces one or more spaces before or after colons in object literals.
* `"align": "value"` enforces horizontal alignment of values in object literals.
* `"align": "colon"` enforces horizontal alignment of both colons and values in object literals.
* `"beforeColon": false (default) | true`
* `false`: disallows spaces between the key and the colon in object literals.
* `true`: requires at least one space between the key and the colon in object literals.
* `"afterColon": true (default) | false`
* `true`: requires at least one space between the colon and the value in object literals.
* `false`: disallows spaces between the colon and the value in object literals.
* `"mode": "strict" (default) | "miniumum"`
* `"strict"`: enforces exactly one space before or after colons in object literals.
* `"minimum"`: enforces one or more spaces before or after colons in object literals.
* `"align": "value" | "colon"`
* `"value"`: enforces horizontal alignment of values in object literals.
* `"colon"` enforces horizontal alignment of both colons and values in object literals.
* `"align"` with an object value allows for fine-grained spacing when values are being aligned in object literals.
* `"singleLine"` specifies a spacing style for single-line object literals.
* `"multiLine"` specifies a spacing style for multi-line object literals.
Expand Down