From 52c89824dda7e47df57974433e2f76b2a18b70e0 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Sun, 12 Nov 2023 14:53:29 +0300 Subject: [PATCH] Updated Code style (markdown) --- Code-style.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Code-style.md b/Code-style.md index f7d3cb0..9e2f075 100644 --- a/Code-style.md +++ b/Code-style.md @@ -2,16 +2,16 @@ > > This page currrely is worked on. There may be some discrepancies or outdated information. Use VS Code and ESLint (`yarn lint`) for code formatting. -# Overview +## Overview This article contains a set of rules and guidelines that you should follow when working on an issue. > ℹ️ **Advice** > > This repository has additional configuration files that contain some formatting rules and recommended extensions for VS Code editor. So, it is recommended to use VS Code editor during the development, since it that case it will be easier to follow these guidelines. -# General +## General -## ⚔️ Indentation and spacing +### ⚔️ Indentation and spacing - **We use tabs**, not spaces. - Separate logical blocks with empty lines - Separate block statements (if/else, try/catch, switch, etc.) with empty lines @@ -31,7 +31,7 @@ function GetMessage(key: string): string { } ``` -## ✒️Naming conventions +### ✒️Naming conventions The project inherits [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines) with some exceptions and additions. Use this table in addition to the main guidelines to determine what naming convention to use @@ -44,7 +44,7 @@ Use this table in addition to the main guidelines to determine what naming conve | | Files in `public` folder | Non-exported variables | | | CSS-in-JS classes | | -## 📖 Documentation +### 📖 Documentation - All exported and public members must be documented using JSDoc syntax - Other parts of code may be documented at will @@ -68,7 +68,7 @@ function GetEnergy(mass: number): number } ``` -## Strings +### Strings Always use "double quotes" for literal string values ```ts // ✅ Correct @@ -80,7 +80,7 @@ import React from 'react'; export const Message: string = 'Hello, World!'; ``` -## Variables vs constants +### Variables vs constants - Always use either `let` or `const` keywords. Do not use `var` - Use `const` when the value will not change. Otherwise, use `let` ```ts @@ -96,7 +96,7 @@ function GetEnergy(mass: number): number } ``` -## Constants vs functions +### Constants vs functions - Use constants with arrow functions only when it's a one-liner: ```ts // ✅ Correct