mirror of
https://github.com/XFox111/PasswordGeneratorExtension.git
synced 2026-04-23 08:08:41 +03:00
Updated Code style (markdown)
+8
-8
@@ -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.
|
> 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.
|
This article contains a set of rules and guidelines that you should follow when working on an issue.
|
||||||
|
|
||||||
> ℹ️ **Advice**
|
> ℹ️ **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.
|
> 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.
|
- **We use tabs**, not spaces.
|
||||||
- Separate logical blocks with empty lines
|
- Separate logical blocks with empty lines
|
||||||
- Separate block statements (if/else, try/catch, switch, etc.) 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.
|
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
|
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 |
|
| | Files in `public` folder | Non-exported variables |
|
||||||
| | CSS-in-JS classes | |
|
| | CSS-in-JS classes | |
|
||||||
|
|
||||||
## 📖 Documentation
|
### 📖 Documentation
|
||||||
- All exported and public members must be documented using JSDoc syntax
|
- All exported and public members must be documented using JSDoc syntax
|
||||||
- Other parts of code may be documented at will
|
- 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
|
Always use "double quotes" for literal string values
|
||||||
```ts
|
```ts
|
||||||
// ✅ Correct
|
// ✅ Correct
|
||||||
@@ -80,7 +80,7 @@ import React from 'react';
|
|||||||
export const Message: string = 'Hello, World!';
|
export const Message: string = 'Hello, World!';
|
||||||
```
|
```
|
||||||
|
|
||||||
## Variables vs constants
|
### Variables vs constants
|
||||||
- Always use either `let` or `const` keywords. Do not use `var`
|
- Always use either `let` or `const` keywords. Do not use `var`
|
||||||
- Use `const` when the value will not change. Otherwise, use `let`
|
- Use `const` when the value will not change. Otherwise, use `let`
|
||||||
```ts
|
```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:
|
- Use constants with arrow functions only when it's a one-liner:
|
||||||
```ts
|
```ts
|
||||||
// ✅ Correct
|
// ✅ Correct
|
||||||
|
|||||||
Reference in New Issue
Block a user