Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guidelines for React with TypeScript #89

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/react/components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: components
title: Components
sidebar_label: Components
---

#### The following convention should be followed for components naming:

* `PascalCase` should be used to name the component file.
* Name of the component should match the filename
* It should be understandable by everyone (no **EntityForListItem)
* it should be simple to use (no SimpleBeanFactoryAwareAspectInstanceFactory)
<br />
```
const SumbitButton = (props: SubmitButtonProps) => {
return (
<div>
....
</div>
)
}
```

30 changes: 30 additions & 0 deletions docs/react/files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: files
title: Files
sidebar_label: Files
---

#### The following convention should be followed for different files name:

* **Interfaces** -
* `PascalCase` should be used for the interfaces names.
* Files could be categorized into folders like
```
> domain
> requests
> responses
> states
> others
```

* **Enums** -
* `PascalCase` should be used for the enum file names.
* Enums could be organized into folder like
```
> enums
Roles.ts
UserType.ts
```
* **Constants** -
* `camelCase` should be used for constants file names.

24 changes: 17 additions & 7 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports =
"type": "category",
"label": "Practices and Tools",
"items": [
"python/general",
"python/tools"
"python/general",
"python/tools"
]
},
"python/docstrings",
Expand Down Expand Up @@ -80,6 +80,16 @@ module.exports =
]
}
],
"React (TypeScript)": [
{
"type": "category",
"label": "Naming Conventions",
"items": [
"react/components",
"react/files"
]
}
],
"Java": [
{
"type": "category",
Expand All @@ -102,15 +112,15 @@ module.exports =
]
}
],
"NoSQL" : [
"NoSQL": [
{
"type": "category",
"label": "Document DB",
"items": [
"nosql/documentdb/document-db-naming-convention",
"nosql/documentdb/one-to-one-relationship",
"nosql/documentdb/one-to-many-relationship",
"nosql/documentdb/many-to-many-relationship"
"nosql/documentdb/document-db-naming-convention",
"nosql/documentdb/one-to-one-relationship",
"nosql/documentdb/one-to-many-relationship",
"nosql/documentdb/many-to-many-relationship"
]
}
],
Expand Down