You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using folders more and more to logically group classes and components and I think that's fantastic. I wonder, however, if we should consider naming the files after what they contain and leaving the index.ts/index.tsx files as pure export files.
I have too many index.tsx files open in tabs right now and it's harder than it needs to be to find the right one.
Anyone against renaming our index files to what their primary contents is and adding an export-only index.ts in their place?
Yeah, I think in the case of adding a single item in a directory like in the case of toolbar I don't think we have to have an index.ts file necessarily. We could either have the file roam in its parent directory or we could import the file explicitly.
I've removed src/ui/index.tsx and src/crash/index.tsx from this list because they're referenced as entry points in webpack - so they're slightly different to the others.
Activity
joshaber commentedon Sep 23, 2016
I worry it might add a bit too much ceremony, but that's probably less bad than the billion index files we have now.
👍
niik commentedon Sep 23, 2016
Yeah, I think in the case of adding a single item in a directory like in the case of toolbar I don't think we have to have an index.ts file necessarily. We could either have the file roam in its parent directory or we could import the file explicitly.
@shiftkey Do you have strong feelings either way?
shiftkey commentedon Sep 26, 2016
I do like renaming these existing
index.ts/tsxfiles to be more specificj-f1 commentedon Oct 27, 2017
index.{ts,tsx}only containingexport * from 'x'andexport { foo, bar } from 'x'lines (32)index.{ts,tsx}files that don’t just re-export other exports:leave this one as-isapp/src/crash/index.tsx— rename tomain.tsx?app/src/ui/autocompletion/index.tsx— moveAutocompleting*toautocompleting-text-input.tsx,IAutocompletionProviderto a new file?app/src/ui/branches/index.tsxapp/src/ui/changes/index.tsxapp/src/ui/create-branch/index.tsxapp/src/ui/delete-branch/index.tsxapp/src/ui/diff/index.tsxapp/src/ui/discard-changes/index.tsxapp/src/ui/history/index.tsxleave this one as-isapp/src/ui/index.tsx— rename tomain.tsx?app/src/ui/rename-branch/index.tsxapp/src/ui/repositories-list/index.tsxshiftkey commentedon Dec 12, 2017
I've removed
src/ui/index.tsxandsrc/crash/index.tsxfrom this list because they're referenced as entry points in webpack - so they're slightly different to the others.