-
Notifications
You must be signed in to change notification settings - Fork 108
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
Meta: Update style guide to discuss preferred orderings of elements #831
Conversation
docs/style-guide.md
Outdated
|
||
## Element Ordering | ||
|
||
This section concerns the order in which containers store elements. |
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.
What is the definition of "container" in this context?
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.
This section concerns the order in which containers store elements. | |
This section concerns the order in which properties are stored and accessed within plain objects. |
Does this apply outside of plain objects?
docs/style-guide.md
Outdated
- [Examples](#examples) | ||
- [Alternative: Kebab case for all string enumerations](#alternative-kebab-case-for-all-string-enumerations) | ||
- [Pros](#pros) | ||
- [Cons](#cons) | ||
- [Decision](#decision) | ||
- [Alternative: Kebab case for new identifiers only](#alternative-kebab-case-for-new-identifiers-only) | ||
- [Pros](#pros-1) | ||
- [Cons](#cons-1) | ||
- [Decision](#decision-1) | ||
- [Alternative: Use kebab case but also accept camel case](#alternative-use-kebab-case-but-also-accept-camel-case) | ||
- [Pros](#pros-2) | ||
- [Cons](#cons-2) | ||
- [Decision](#decision-2) | ||
- [Identifiers defined outside ECMA-402](#identifiers-defined-outside-ecma-402) | ||
- [Examples](#examples-1) | ||
- [Alternative: Convert identifiers to camel case](#alternative-convert-identifiers-to-camel-case) | ||
- [Pros](#pros-3) | ||
- [Cons](#cons-3) | ||
- [Decision](#decision-3) |
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.
Are the whitespace changes necessary?
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.
changed it back to the previous spacing
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.
The previous spacing was 4 spaces and your new version has 2 spaces 🙈
5a261af
to
1ef3e6a
Compare
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.
Some old comments and some new ones, let's clean this one up!
docs/style-guide.md
Outdated
|
||
## Element Ordering | ||
|
||
This section concerns the order in which containers store elements. |
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.
This section concerns the order in which containers store elements. | |
This section concerns the order in which properties are stored and accessed within plain objects. |
Does this apply outside of plain objects?
docs/style-guide.md
Outdated
- [Examples](#examples) | ||
- [Alternative: Kebab case for all string enumerations](#alternative-kebab-case-for-all-string-enumerations) | ||
- [Pros](#pros) | ||
- [Cons](#cons) | ||
- [Decision](#decision) | ||
- [Alternative: Kebab case for new identifiers only](#alternative-kebab-case-for-new-identifiers-only) | ||
- [Pros](#pros-1) | ||
- [Cons](#cons-1) | ||
- [Decision](#decision-1) | ||
- [Alternative: Use kebab case but also accept camel case](#alternative-use-kebab-case-but-also-accept-camel-case) | ||
- [Pros](#pros-2) | ||
- [Cons](#cons-2) | ||
- [Decision](#decision-2) | ||
- [Identifiers defined outside ECMA-402](#identifiers-defined-outside-ecma-402) | ||
- [Examples](#examples-1) | ||
- [Alternative: Convert identifiers to camel case](#alternative-convert-identifiers-to-camel-case) | ||
- [Pros](#pros-3) | ||
- [Cons](#cons-3) | ||
- [Decision](#decision-3) |
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.
The previous spacing was 4 spaces and your new version has 2 spaces 🙈
bafaa25
to
1a826c9
Compare
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.
Overall LGTM, thanks!
docs/style-guide.md
Outdated
:star2: <em>The `resolvedOptions` of Intl objects should appear in the following order: | ||
|
||
1. `locale` | ||
2. All properties (given in lexicographical order) that can be set by extension keys and that are guaranteed to exist | ||
3. Properties (in lexicographical order) that are not set by extension keys and that are guaranteed to exist | ||
4. All properties (in lexicographical order) that exist conditionally.</em> :star2: |
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.
Is this whole section purposefully italicized?
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.
Yes, to match the italicization in the other starred blocks. I do admit that italicizing the list might be a situation where the result of insisting on consistency is ugly enough that it's the wrong thing to do.
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.
I think one way to do it would be to rephrase the first sentence into a summarized guideline, star+italicize it and follow that with the full list. An entire list being starred/italicized doesn't really say much and looks weird.
@gibson042 what do you think about this version? |
2404d76
to
83a6734
Compare
edc362a
to
ea71f4c
Compare
…ions ordering Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
a833087
to
346a5c3
Compare
@gibson042 Does this look good to merge? |
Toward #578
1795b9d inspired by #578
29e183b inspired by tc39/proposal-intl-duration-format#163