Sfoglia il codice sorgente

Explain _ and UPPER_CASE naming

master
Lyubo Marinov 8 anni fa
parent
commit
3af6cc53d1
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9
    0
      doc/coding-style.md

+ 9
- 0
doc/coding-style.md Vedi File

@@ -82,3 +82,12 @@
82 82
     imports in other files should use the same name. Don't define the class
83 83
     `Registry` in ReducerRegistry.js and then import it as `Reducers` in other
84 84
     files.
85
+
86
+* The names of global constants (including ES6 module-global constants) should
87
+  be written in uppercase with underscores to separate words. For example,
88
+  `BACKGROUND_COLOR`.
89
+
90
+* The underscore character at the beginning of a name signals that the
91
+  respective variable, function, property is non-public i.e. private, protected,
92
+  or internal. In contrast, the lack of an underscore at the beginning of a name
93
+  signals public API.

Loading…
Annulla
Salva