Skip to content

Commit

Permalink
Update README.md (deriv-com#16105)
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv authored Jul 19, 2024
1 parent f80781c commit 297d0f3
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions packages/trader/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# Deriv App
# DTrader

This repository contains the static HTML, Javascript, CSS, and images content of the [Deriv](http://app.deriv.com) website.
This repository contains the static HTML, Javascript, CSS, and images content of the [DTrader](http://app.deriv.com/dtrader) website.

## Style Guide

- [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript/blob/master/README.md) is partially being followed in our dtrader code base.

### Naming Conventions

<a id="naming-conventions-variables"></a>
**[Variables:](#naming-conventions-variables)** Variables should be lowercase words separated by `_` (snake_case) .

```JavaScript
const field_name = '...';
```

<a id="naming-conventions-constant-contents"></a>
**[Constant(Static) contents:](#naming-conventions-constant-contents)** Constant(Static) contents(numbers or strings) should be `UPPER_SNAKE_CASE`. UPPER CASE and separated by `_`.

```JavaScript
const MY_STATIC_CONTENT = '...';
```

<a id="naming-conventions-functions"></a>
**[Functions:](#naming-conventions-functions)** Functions should be camelCase. This is to easily distinguish between variables and functions.

```JavaScript
const myFunction = () => { ... };
```

<a id="naming-conventions-modules"></a>
**[Modules:](#naming-conventions-modules)** Module names and classes should be PascalCase.

```JavaScript
const MyModule = (() => { ... })();
```

<a id="naming-conventions-javascript-elements"></a>
**[JavaScript elements:](#naming-conventions-javascript-elements)** JavaScript elements start with `el_` for a similar effect.

```JavaScript
const el_test = document.getElementById('test');
```

<a id="naming-conventions-boolean"></a>
**[Boolean:](#naming-conventions-boolean)** Those variables which store a boolean value, should start with `is_`, `has_`, ...

```JavaScript
const is_updated = true;
const has_crypto = false;
```

0 comments on commit 297d0f3

Please sign in to comment.