3 ms·
That issue with too many index.ts files used to be a major issue but nowadays I use VS Code which disambiguates matching filenames with their parent directory.
by beaconstudios 5y ago
That issue with too many index.ts files used to be a major issue but nowadays I use VS Code which disambiguates matching filenames with their parent directory.
I think I just don't really like using re-exporting index files if I can avoid them, because I don't see much of a positive cost/benefit in most cases. In your example I'd be doing something like this instead:
import { mywidget } from '@foo/components/mywidget';
import { mycomplexwidget } from '@foo/components/mycomplexwidget';
I could fish for pseudo-objective arguments for this but honestly I think it's mostly just personal preference!
- deanc 5y ago> That issue with too many index.ts files used to be a major issue but nowadays I use VS Code which disambiguates matching filenames with their parent directory. Any source on that. I'm in vscode right now with several index.tsx files open and no disambiguation in the tabs.
- beaconstudios 5y agohere's a screenshot from my VS Code right now: https://imgur.com/a/kTbBjJP https://imgur.com/a/kTbBjJP it's controlled by the "workbench.editor.labelFormat" setting, but the default will disambiguate when two files share a name.