I have an ReactJs project and I am organizing my files. Is it best to create a folder for interfaces and a different folder for types or should we keep the interfaces and types together
example
MyProject
-src
-components
-interfaces
-editorInterface
-type
-editorTypes
>Solution :
I use the below structure
src/
└── ts
├── enums
│ ├── app_enums.ts
│ └── db_enums.ts
├── interfaces
│ ├── app_interfaces.ts
│ ├── db_interfaces.ts
│ └── global_interfaces.ts
└── types
└── app_types.ts
Directories names express their purpose well. interfaces directory includes all interfaces and types directory includes all type aliases you use in your project.You can merge these directories if you wish but I found splitting types semantically and structurally is really helpful when managing large code bases. Try to figure out what works best for you. There is no golden rule when it comes to project directory structure