As an intermediate step on the path to merging jitsi-meet and
jitsi-meet-react, import the whole source code of jitsi-meet-react as it
stands at
2f23d98424
i.e. the lastest master at the time of this import. No modifications are
applied to the imported source code in order to preserve a complete
snapshot of it in the repository of jitsi-meet and, thus, facilitate
comparison later on. Consequently, the source code of jitsi-meet and/or
jitsi-meet-react may not work. For example, jitsi-meet's jshint may be
unable to parse jitsi-meet-react's source code.
2.6 KiB
Comments
-
Comments documenting the source code are required.
-
Comments from which documentation is automatically generated are not subject to case-by-case decisions. Such comments are used, for example, on types and their members. Examples of tools which automatically generate documentation from such comments include JSDoc, Javadoc, Doxygen.
-
Comments which are not automatically processed are strongly encouraged. They are subject to case-by-case decisions. Such comments are often observed in function bodies.
-
-
Comments should be formatted as proper English sentences. Such formatting pays attention to, for example, capitalization and punctuation.
Duplication
- Don't copy-paste source code. Reuse it.
Formatting
-
Line length is limited to 80 characters.
-
Sort by alphabetical order in order to make the addition of new entities as easy as looking a word up in a dictionary. Otherwise, one risks duplicate entries (with conflicting values in the cases of key-value pairs). For example:
-
Within an
importof multiple names from a module, sort the names in alphabetical order. (Of course, the default name stays first as required by theimportsyntax.)import { DOMINANT_SPEAKER_CHANGED, JITSI_CLIENT_CONNECTED, JITSI_CLIENT_CREATED, JITSI_CLIENT_DISCONNECTED, JITSI_CLIENT_ERROR, JITSI_CONFERENCE_JOINED, MODERATOR_CHANGED, PEER_JOINED, PEER_LEFT, RTC_ERROR } from './actionTypes'; -
Within a group of imports (e.g. groups of imports delimited by an empty line may be: third-party modules, then project modules, and eventually the private files of a module), sort the module names in alphabetical order.
import React, { Component } from 'react'; import { connect } from 'react-redux';
-
Indentation
-
Align
switchandcase/default. Don't indent thecase/defaultmore than itsswitch.switch (i) { case 0: ... break; default: ... }
Naming
-
An abstraction should have one name within the project and across multiple projects. For example:
-
The instance of lib-jitsi-meet's
JitsiConnectiontype should be namedconnectionorjitsiConnectionin jitsi-meet-react, notclient. -
The class
ReducerRegistryshould be defined in ReducerRegistry.js and its imports in other files should use the same name. Don't define the classRegistryin ReducerRegistry.js and then import it asReducersin other files.
-