-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Currently, the code related to a single component is spread in three different places, eg:
src/components/Component.tsx
src/styles/Component.module.css
test/Component.test.tsx
The proposal is to create a subdirectory in components that contains all the files:
src/components/Component/Component.tsx
src/components/Component/Component.module.css
src/components/Component/Component.test.tsx
More details, from #188:
I think we could reorganize the files a bit, like I did in hightable, loosely following https://www.joshwcomeau.com/react/file-structure/:
- move the files from components/viewers to components/ (no semantic hierarchy)
- move every component file to its own subdirectory (App.tsx -> App/App.tsx)
- move the styles (CSS modules) to these subdirectories (styles/Json.module.css => components/Json/Json.module.css)
- (maybe) move the tests to these subdirectories (test/Layout.test.tsx => components/Layout/Layout.test.tsx) - it requires tweaking the build process to ignore these files.
It would help find the files quickly, and it would group the styles and components together
Metadata
Metadata
Assignees
Labels
No labels