From 0c61424d9536140812a81f873e4251892a1c5bfa Mon Sep 17 00:00:00 2001 From: Vse Mozhe Buty Date: Wed, 16 Jun 2021 23:56:11 +0300 Subject: [PATCH 1/2] Fix some typos in CONTRIBUTING.md --- CONTRIBUTING.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6711d5dbe..46ecba662 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,13 +46,13 @@ Algorithms in this repo should not be how-to examples for existing JavaScript pa #### File Naming Convention - filenames should use the UpperCamelCase (PascalCase) style. - - There should be no spaces in filenames. + - There should be no spaces in filenames. **Example:**`UserProfile.js` is allowed but `userprofile.js`,`Userprofile.js`,`user-Profile.js`,`userProfile.js` are not #### Testing -Be confident that your code works. When was the last time you committed a code change, your build failed, and half of your app stopped working? Mine was last week. Writing tests for our Algorithms will help us ensure the implementations are air tight even after multiple fixes and code changes. -We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate an function and ensure a required result. +Be confident that your code works. When was the last time you committed a code change, your build failed, and half of your app stopped working? Mine was last week. Writing tests for our Algorithms will help us ensure the implementations are air tight even after multiple fixes and code changes. +We use a NPM package [doctest](https://www.npmjs.com/package/doctest) to add basic testing functionality to our code. Doctests are simple structured comments that evaluate a function and ensure a required result. The implementation of doctest is quite simple. You can easily learn it [here](https://www.npmjs.com/package/doctest). @@ -76,23 +76,23 @@ To maximize the readability and correctness of our code, we require that new sub $ standard MyFile.js // if that fails, try: npx standard MyFile.js ``` -- Use camelCase for with leading character lowercase for identifier names (variables and functions) +- Use camelCase with leading character lowercase 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 - for (let i = 0; i < arrayOfNumbers.length; i++) { - sum += arrayOfNumbers[i] - } - return (sum) + let sum = 0 + for (let i = 0; i < arrayOfNumbers.length; i++) { + sum += arrayOfNumbers[i] } + return (sum) + } ``` - Avoid using global variables and avoid '==' - Please use 'let' over 'var' -- Please use 'console.log()' +- Please use 'console.log()' - We strongly recommend the use of ECMAScript 6 - Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms. - Most importantly, From 1b5c705aa9bf517d18d13b3848f5f3a83f75ab7b Mon Sep 17 00:00:00 2001 From: Rak Laptudirm <68542775+raklaptudirm@users.noreply.github.com> Date: Thu, 17 Jun 2021 11:02:01 +0530 Subject: [PATCH 2/2] chore: Fix grammatical errors --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46ecba662..3cd180690 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ To maximize the readability and correctness of our code, we require that new sub $ standard MyFile.js // if that fails, try: npx standard MyFile.js ``` -- Use camelCase with leading character lowercase for identifier names (variables and functions) +- Use camelCase with the leading character as lowercase for identifier names (variables and functions) - Names start with a letter - follow code indentation - Always use 2 spaces for indentation of code blocks