Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: pages/coding-style.html

Issue 29375722: Noissue - Update the JavaScript coding style guide regarding ESLint (Closed)
Patch Set: Addressed Sebastian's feedback Created Feb. 15, 2017, 11:21 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pages/coding-style.html
diff --git a/pages/coding-style.html b/pages/coding-style.html
index 030223c36312fca76d2db5827140905cf10fd5fd..66a386c6f4d02929bbdd1d7d589e02572b835fe9 100644
--- a/pages/coding-style.html
+++ b/pages/coding-style.html
@@ -26,8 +26,9 @@ title=Coding Style
<li>{{s15 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style#JavaScript_practices">JavaScript practices</a>.}}</li>
<li>{{javascript-strict Always use <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode">strict mode</a>.}}</li>
<li>{{javascript-opening-braces Opening braces of object literals don't go on their own line when that would cause a syntax error.}}</li>
- <li>{{javascript-if-else-braces When an <code><fix>if</fix></code> statement, an <code><fix>else</fix></code> statement or a loop spans over more than one line always enclose it with braces. When an <code><fix>if</fix></code> or <code><fix>else</fix></code> statement uses braces the opposing block should do too.}}</li>
+ <li>{{javascript-if-else-braces When an <code><fix>if</fix></code> statement, an <code><fix>else</fix></code> statement or a loop spans over more than one line always enclose it with braces.}}</li>
<li>{{s18 In classes, prefix private functions with a single underscore to make them pseudo-private.}}</li>
+ <li>{{javascript-spacing-literals Don't add spaces directly inside of Object and Array literals.}}</li>
Sebastian Noack 2017/02/15 11:34:45 I don't think that Object and Array need to be cap
kzar 2017/02/15 11:48:55 Yea I found this rule hard to word and I think you
<h3 id="javascript-modern">{{javascript-es6 Modern JavaScript (where supported)}}</h3>
<ul>
<li>{{javascript-block-scoping Always use <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/block#With_let_and_const">block-scoping</a> (<code><fix>let</fix></code> / <code><fix>const</fix></code>), except when sharing global variables between scripts cannot be avoided.}}</li>
@@ -36,6 +37,7 @@ title=Coding Style
<li>{{javascript-method Use the <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Method_definitions">method definition shorthand</a> syntax when defining methods on an object.}}</li>
<li>{{javascript-for-of When iterating over arrays in the canonical order use the new <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of"><code><fix>for..of</fix></code></a> syntax if the loop index isn't required. (Rather than using <code><fix>for(;;)</fix></code> or the <code><fix>forEach()</fix></code> method.)}}</li>
<li>{{javascript-map-set Use the <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map"><code><fix>Map</fix></code></a> or <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set"><code><fix>Set</fix></code></a> objects, rather than misusing plain objects, when you need a hash table.}}</li>
+ <li>{{javascript-eslint Run <a href="http://eslint.org"><fix>ESLint</fix></a> with the <a href="https://hg.adblockplus.org/codingtools/file/tip/eslint-config-eyeo"><fix>eslint-config-eyeo</fix></a> configuration and fix any warning.}}</li>
</ul>
</ul>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld