-
Notifications
You must be signed in to change notification settings - Fork 0
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CLOSED] All source mixes quote styles #1092
Comments
Comment by peterflynn Per our style guide all JS code should be using double quotes: https://github.com/adobe/brackets/wiki/Brackets%20Coding%20Conventions |
Comment by rwaldron Neat - style guides are boss :) |
Comment by pthiess Reviewed - we should use double quotes everywhere - leave it unassigned for now. |
Comment by glortho Does this apply to nested quotes as well? For example, should the single quotes below be converted to escaped double quotes or left as they are?
Same question for these:
As this isn't explicit in the style guide, I personally prefer leaving the first one as is and changing the formatting of the second to match the first, but let me know and I'll make it happen. |
Comment by peterflynn +1 Although note that for HTML code in a real .html file, we do use double quotes -- so basically I think the proposal is that the outermost language in the file uses double quotes, while any language nested inside strings uses single quotes if possible. |
Comment by rwaldron FWIW, in the jQuery source and tests we use: var html = "<div id='single-quotes-for-attributes'></div>"; |
Comment by ghost Can we just use double quotes on the whole just to make everything look the same and clean? |
Comment by peterflynn
Does that seem fair to you, or are you saying you prefer the second form? |
Comment by ghost Oh I am sorry I misinterpreted the proposal, I prefer the first it is much more readable. |
Comment by peterflynn Ok, sounds like there's a pretty solid consensus then. I've updated the description at top, and I'll update the style guide to cover the nesting case too. |
Comment by JonathanWolfe I've done this issue with the pull request here (adobe/brackets#1211). I don't know how to attach a pull request to an issue though. |
Comment by redmunds Marking FBNC (fixed but not closed) so filer can verify fix. |
Comment by rwaldron LGTM (If I come across any deviations, I'll post back here on the closed ticket) |
Comment by peterflynn Thanks rwldrn! Closing this one out for now. |
Issue by rwaldron
Thursday Jun 21, 2012 at 20:47 GMT
Originally opened as adobe/brackets#1100
Brackets source code should consistently use double quotes for JS string literals and HTML attribute values. With one exception: if the code is inside a string literal (which already uses double quotes), use single quotes instead to avoid escaping.
The current codebase mostly follows these styles, but it's inconsistent in a few places.
Examples:
original description:
I'm not advocating for either, but perhaps a definitive decision to use either single or double throughout the entire code base would be beneficial for maintainability.
The text was updated successfully, but these errors were encountered: