Pārlūkot izejas kodu

Explain _ and UPPER_CASE naming

master
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
3af6cc53d1
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9
    0
      doc/coding-style.md

+ 9
- 0
doc/coding-style.md Parādīt failu

82
     imports in other files should use the same name. Don't define the class
82
     imports in other files should use the same name. Don't define the class
83
     `Registry` in ReducerRegistry.js and then import it as `Reducers` in other
83
     `Registry` in ReducerRegistry.js and then import it as `Reducers` in other
84
     files.
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.

Notiek ielāde…
Atcelt
Saglabāt