You can find on this link the exhaustive list of the notations used here.
The types
, classes
, interfaces
and enums
MUST respect the PascalCase
notation.
/**
* 😍 Cool 😍
*/
type PermissionLevel = /* ... */;
class ConnectionModule {
// ...
}
interface UserRole {
// ...
}
enum OidcRoutes {
// ...
}
/**
* 😱 Not cool 😱
*/
type _PermissionLevel = /* ... */;
class connectionModule {
// ...
}
interface user_role {
// ...
}
enum OIDCRoutes {
// ...
}
The global constants
, enum properties
and environment variables
MUST respect the SCREAMING_SNAKE_CASE
notation.
/**
* 😍 Cool 😍
*/
const ROUTES_PREFIX = /* ... */;
process.env.TLS_PRIV_KEY = /* ... */;
enum DevelopersTypes {
FRONT_END = /* ... */;
BACK_END = /* ... */;
}
/**
* 😱 Not cool 😱
*/
const routes_prefix = /* ... */;
process.env.tlspubcert = /* ... */;
enum DevelopersTypes {
frontEnd = /* ... */;
BackEnd = /* ... */;
}
The variables
, properties
, functions name
and functions parameters
MUST respect the camelCase
notation.
/**
* 😍 Cool 😍
*/
const userLastConnection = /* ... */;
let pseudo = /* ... */;
function doABarrelRoll(direction: BarrelDirection): boolean {
// ...
}
const user = {
pseudo: /* ... */,
lastConnection: /* ... */,
createdAt: /* ... */,
}
/**
* 😱 Not cool 😱
*/
const user_last_connection = /* ... */;
let Pseudo = /* ... */;
function Do_A_Barrel_Roll(direCtion: BarrelDirection): boolean {
// ...
}
const user = {
_pseudo: /* ... */,
last_Connection: /* ... */,
'created-at': /* ... */,
}
Observable
variables must use the conventional suffix $
.
/**
* 😍 Cool 😍
*/
let message$ = /* ... */;
/**
* 😱 Not cool 😱
*/
let me$$age = /* ... */;
let observable = /* ... */;
The files name
and directories name
MUST respect the lisp-case
notation, followed by their extension
.
- 🚩 Files name CAN contain one or more
"."
to help identifying the file type aside the extension (services, components, etc... See [11 - Files and directories architecture]<./11-files-and-directories-architecture.md> for more details). - 🚩 Directories name CAN be prefixed by a single
"_"
if they MUST appear first.
##############
# 😍 Cool 😍 #
##############
user-update.service.ts
.gitlab-ci.yml
user-fixtures/
_doc/
##################
# 😱 Not cool 😱 #
##################
user_update.service.ts
user-update.service
Gitlab-ci.yml
user\ fixtures/
_Doc/
Characters used MUST be within standard ASCII table with the exception of comments (see 9 - Comments for more).
/**
* 😍 Cool 😍
*/
const userLastConnection = /* ... */;
/**
* 😱 Not cool 😱
*/
const ウセル_ラスト_コネチウン = /* ... */;
/**
* 😍 Cool 😍
*/
// 💡 This is a perfectly 🍷 valid comment 😉
##############
# 😍 Cool 😍 #
##############
./services/user-update.service.ts
##################
# 😱 Not cool 😱 #
##################
./ダタバイズ/ラスト-コネチウン/ウセル.db
Names MUST remain intelligible
, explicit
, mnemonic
and reflect their usage
at first glance. They MUST be written in English.
/**
* 😍 Cool 😍
*/
const username = /* ... */;
class UserService {
// ...
}
interface DatabaseConfig {
// ...
}
let i = 0;
/**
* 😱 Not cool 😱
*/
const u = /* ... */;
const username = 42;
class Service {
// ...
}
interface UserButWithoutThatProperty {
// ...
}
let omeletteDuFromage = /* ... */;
Abreviations
are tolerated and MUST respect the nomenclature rules described in the previous section.
/**
* 😍 Cool 😍
*/
const oidcCallback = /* ... */; // =### openIdConnectCallback
const TLS_PRIV_KEY = /* ... */;
/**
* 😱 Not cool 😱
*/
let odf = /* ... */; // =### omeletteDuFromage 🙈
class UsrServ {
// ...
}