From 9d003122f211dac668035b44180ccd2933ddfe87 Mon Sep 17 00:00:00 2001 From: samirsilwal Date: Thu, 17 Nov 2022 16:26:17 +0545 Subject: [PATCH 1/4] Add naming convention for react components --- docs/react/components.md | 10 ++++++++++ sidebars.js | 23 ++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 docs/react/components.md diff --git a/docs/react/components.md b/docs/react/components.md new file mode 100644 index 0000000..30f9a5b --- /dev/null +++ b/docs/react/components.md @@ -0,0 +1,10 @@ +--- +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. +* `` diff --git a/sidebars.js b/sidebars.js index 19e521c..b301110 100644 --- a/sidebars.js +++ b/sidebars.js @@ -43,8 +43,8 @@ module.exports = "type": "category", "label": "Practices and Tools", "items": [ - "python/general", - "python/tools" + "python/general", + "python/tools" ] }, "python/docstrings", @@ -80,6 +80,15 @@ module.exports = ] } ], + "React with TS": [ + { + "type": "category", + "label": "Naming Conventions", + "items": [ + "react/components" + ] + } + ], "Java": [ { "type": "category", @@ -102,15 +111,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" ] } ], From 5473d05ca49e18ce2bc2de8bd9762155a6e21998 Mon Sep 17 00:00:00 2001 From: samirsilwal Date: Thu, 17 Nov 2022 18:10:43 +0545 Subject: [PATCH 2/4] Fix filename --- docs/react/components.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/react/components.md b/docs/react/components.md index 30f9a5b..e76ed76 100644 --- a/docs/react/components.md +++ b/docs/react/components.md @@ -7,4 +7,6 @@ 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) From 34f22452c3421bae96414aa35a5410dcdccd1024 Mon Sep 17 00:00:00 2001 From: samirsilwal Date: Thu, 17 Nov 2022 19:23:39 +0545 Subject: [PATCH 3/4] Add file name convention for react --- docs/react/components.md | 15 +++++++++++++-- docs/react/files.md | 30 ++++++++++++++++++++++++++++++ sidebars.js | 3 ++- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 docs/react/files.md diff --git a/docs/react/components.md b/docs/react/components.md index e76ed76..b3203a7 100644 --- a/docs/react/components.md +++ b/docs/react/components.md @@ -8,5 +8,16 @@ sidebar_label: Components * `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) + * It should be understandable by everyone (no **EntityForListItem) + * it should be simple to use (no SimpleBeanFactoryAwareAspectInstanceFactory) +
+ ``` + const SumbitButton = (props: SubmitButtonProps) => { + return ( +
+ .... +
+ ) + } + ``` + diff --git a/docs/react/files.md b/docs/react/files.md new file mode 100644 index 0000000..c4d1fc3 --- /dev/null +++ b/docs/react/files.md @@ -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. + \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index b301110..da1f61c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -85,7 +85,8 @@ module.exports = "type": "category", "label": "Naming Conventions", "items": [ - "react/components" + "react/components", + "react/files" ] } ], From 20366a312734ec486dddd2a48e99f54726af2a66 Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Thu, 26 Jan 2023 12:37:45 +0545 Subject: [PATCH 4/4] Update sidebars.js --- sidebars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sidebars.js b/sidebars.js index da1f61c..f6a8c13 100644 --- a/sidebars.js +++ b/sidebars.js @@ -80,7 +80,7 @@ module.exports = ] } ], - "React with TS": [ + "React (TypeScript)": [ { "type": "category", "label": "Naming Conventions",