From 90e13c0ad913ee34d3b1c1e94ccf21a13e2fe907 Mon Sep 17 00:00:00 2001 From: vinayak Date: Sun, 3 May 2020 17:56:44 +0530 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5aaf1e1f7..2cd559c9a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,18 +48,29 @@ Algorithms in this repo should not be how-to examples for existing Javascript pa #### Coding Style We want your work to be readable by others; therefore, we encourage you to note the following: +- Must follow [JavaScript Standard Style](https://standardjs.com/) + - Command to install JavaScript Standard Style + ``` + $ npm install standard --save-dev + ``` + - Usage + ``` + $ standard + ``` + - Use camelCase for identifier names (variables and functions) - Names start with a letter - follow code indentation - Always use 2 spaces for indentation of code blocks ``` - function sumOfArray(arrayOfNumbers) { - let sum = 0; + function sumOfArray (arrayOfNumbers) { + let sum = 0 for (let i = 0; i < arrayOfNumbers.length; i++) { - sum += arrayOfNumbers[i]; + sum += arrayOfNumbers[i] } - return (sum); + return (sum) } + ``` - Avoid using global variables and avoid '==' - use 'let' over 'var'