Skip to content

Commit

Permalink
Fix consecutive heading levels
Browse files Browse the repository at this point in the history
  • Loading branch information
ctoffanin committed Nov 28, 2022
1 parent ae9316d commit 87eb78d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 43 deletions.
46 changes: 17 additions & 29 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,91 +5,79 @@
Choosing good names is critical to creating code that is easy to use and easy to understand. You
should always take the time to think about whether you have chosen the right name for something.

#### English
### English

All code, names, comments, etc. must be in English.

#### Use one name for one thing
### Use one name for one thing

Do not reuse names. Do not use names that can mean multiple things. Always use the same name for the
same thing.

#### Descriptive
### Descriptive

Names must be descriptive for the working or usage of the class, method or variable.

###### The name should always end with what the object is.

For example: a button must always end with `Button`.

- `MenuButton` a button used in the menu
- `ButtonMenu` a menu with buttons
- `MenuButtonIcon` an icon in the button of the menu

There is no limit for the length of a name, so prefer a long name which is clear and descriptive
than a short name which is not clear.

#### Context
### Context

A name should make sense within its context and should not have unnecessary information for that
context. For example a variable that holds the name of a user can be named `name` within a `User`
context. However if you need to hold the name of a user in another place, `userName` might be a
better name. Adding `user` within a `User` context (`user.userName`) is redundant and should be
avoided.

#### Interfaces
### Interfaces

Interfaces should use the `I` as prefix. Like `IMyInterface`

#### Functions
### Functions

Prefer using a verb as a name to indicate it will do something. Like `render`, `open` or `getData`.

#### Variables, properties, etc.
### Variables, Properties, etc.

All non-functions should have a noun as a name, not a verb.

#### Booleans
### Booleans

Should start with `is`, `has`, `will` or `should`. Like `isValid` or `hasValues`.

#### Always Affirmative
### Always Affirmative

Avoid negations. Prefer `isShown` over `isHidden` or
`isEnabled` over `isDisabled`. Do not use names like `notEditable`.

### Casing
## Casing

#### Classes, Interfaces, Types, Enums and Generics
### Classes, Interfaces, Types, Enums and Generics

**PascalCase** Every individual word start with an upper case character, no underscores, no dashes.

#### Functions, properties, arguments and variables
### Functions, Properties, Arguments and Variables

**camelCase** Starts with a lower case character, every following individual word start with an
upper case character, no underscores, no dashes.

#### Globally used constants
### Globally used constants

**SNAKE_UPPER_CASE** Only use upper case characters, individual words must be separated with an underscore.

### File names
## File names

#### Page files, data files and hook files
### Page files, data files and hook files

**camelCase** Starts with a lower case character, every following individual word start with an
upper case character, no underscores, no dashes.

#### Component files
### Component files

**PascalCase** Every individual word start with an upper case character, no underscores, no dashes.


## Coding

### Functions

Deconstructed props in the function parameters rather than inside the function body
Deconstruct props in the function parameters rather than inside the function body

```ts
interface IProps {
Expand Down
28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ Storybook - [Storybook Documentation](https://storybook.js.org/)

## How to contribute

0. Please check the [coding standards](https://github.com/AccessibleForAll/AccessibleWebDev/blob/main/CODING_STANDARDS.md) page before start contributing.
1. Look through [Pre-existing issues](https://github.com/AccessibleForAll/AccessibleWebDev/issues) or [Raise a new issue](https://github.com/AccessibleForAll/AccessibleWebDev/issues/new/choose) and ask to be assigned. Pull requests made without a corresponding issue will likely be closed.
2. [Fork](https://github.com/AccessibleForAll/AccessibleWebDev/fork) the project
3. Clone the project:
2. Please check the [coding standards](https://github.com/AccessibleForAll/AccessibleWebDev/blob/main/CODING_STANDARDS.md) page before start contributing.
3. [Fork](https://github.com/AccessibleForAll/AccessibleWebDev/fork) the project
4. Clone the project:
```bash
git clone https://github.com/<your-github-username>/AccessibleWebDev
```
4. Navigate to the project directory:
5. Navigate to the project directory:
```bash
cd AccessibleWebDev
```
5. Set the upstream repository:
6. Set the upstream repository:
```bash
git remote add upstream https://github.com/AccessibleForAll/AccessibleWebDev.git
```
6. Install dependencies:
7. Install dependencies:
```bash
yarn install
```
7. Create a new branch:
8. Create a new branch:
```bash
git checkout -b <YourBranchName>
```
8. To run the whole project locally:
9. To run the whole project locally:
```bash
yarn dev
```
Expand All @@ -50,21 +50,21 @@ Storybook - [Storybook Documentation](https://storybook.js.org/)
yarn storybook
```

9. Make your changes
10. Stage your changes:
10. Make your changes
11. Stage your changes:
```bash
git add <NameOfFileChanged>
```
11. Commit your changes:
12. Commit your changes:
```bash
git commit -m "<Your commit message here>"
```
12. Push your commits to your local repository
13. Push your commits to your local repository
```bash
git push origin <YourBranchName>
```
13. Create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
14. Wait for maintainers to review your pull request and suggest any changes
14. Create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
15. Wait for maintainers to review your pull request and suggest any changes

**Congratulations!** You made a contribution to the Accessible For All Community!

Expand Down

0 comments on commit 87eb78d

Please sign in to comment.