Skip to content

Style Guide

YayL edited this page Sep 23, 2021 · 1 revision

Style Guide

This is used to keep the bots styling and notation clean.

Strings

Without Variables

All string that do not use variables use single quotation marks. i.e.

console.log('Hello, new user!');

With Variables

Strings that use variables use back ticks. i.e.

console.log(`Hello, ${displayName}!`);

String concatenation

Adding strings is a no go. ${} is how variables are implemented. i.e.

console.log(`Number: ${number}`);

Files Naming Notation

All files that are in a subdirectory of any of the command folders use alphabetical & lowercased names ONLY

  • commands
    • Economy
      • pay.js
      • marketview.js

On the other hand, all files in a subdirectory of the events folder are to use camelCase unless

  • events
    • gangEvents
      • joinedGang.js

Variable Naming Notation

Non constant variables should be using camelCase

let thisIsAVariable = 'One, Two, Three. Hello!';

Constant variables should use SNAKE_CASE

const THIS_IS_A_CONSTANT = 'Hello! One, Two, Three!'

Database Naming Notation

Column names should be named using snake_case. Try your best not to use underscores!

Other

All lines code should use semicolons

let var = 'hello'

✔️ let var = 'hello';

Clone this wiki locally