[Docs] Edit for clarity

Around line 143, gave "constants" its own bullet point. Although it is a form of variable or field, it also forms a separate style element with a different guideline. It's also easier to find when skimming when separated - for new contributors who need to learn the style, and veteran contributors who are just double checking.
This commit is contained in:
J.D. Sandifer 2017-04-23 07:48:42 -07:00 committed by GitHub
parent 7c7803310b
commit 8e82a4a66d

View File

@ -139,12 +139,12 @@ JavaScript sources in Open MCT should:
* Classes should use camel case, first letter capitalized * Classes should use camel case, first letter capitalized
(e.g. SomeClassName.) (e.g. SomeClassName.)
* Methods, variables, fields, and function names should use camel case, * Methods, variables, fields, and function names should use camel case,
first letter lower-case (e.g. someVariableName.) Constants first letter lower-case (e.g. someVariableName.)
(variables or fields which are meant to be declared and initialized * Constants (variables or fields which are meant to be declared and
statically, and never changed) should use only capital letters, with initialized statically, and never changed) should use only capital
underscores between words (e.g. SOME_CONSTANT.) letters, with underscores between words (e.g. SOME_CONSTANT.)
* File name should be the name of the exported class, plus a .js extension * File names should be the name of the exported class, plus a .js extension
(e.g. SomeClassName.js) (e.g. SomeClassName.js).
* Avoid anonymous functions, except when functions are short (a few lines) * Avoid anonymous functions, except when functions are short (a few lines)
and/or their inclusion makes sense within the flow of the code and/or their inclusion makes sense within the flow of the code
(e.g. as arguments to a forEach call.) (e.g. as arguments to a forEach call.)