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
command+p to open a component doesn't works as good
git: Reading the Changes is slightly harder
Describe the proposed solution
Rename the "src/lib/Counter/index.svelte" to "src/lib/Counter/Counter.svelte"
Keep the src/routes/todos/index.svelte as-is, that filename is used for routing.
(I'd personally would split the rendering of the form of into a component, but for example-code it's easier to digest if it remains in a single file )
Alternatives considered
I've worked with vue and react codebases that worked with lots of index.ts files. When I've renamed these files to have meaningful and predictable filenames the reaction has been universally positive.
An alternative is to do nothing, the filename convention in the example does not affect how we setup a svelte-kit project.
Importance
nice to have
The text was updated successfully, but these errors were encountered:
This would be a breaking change as the semantics for counter/Counter.svelte right now would be "url is counter/counter. For refactoring, you now would need to rename both the file and the folder when you want to change the URL, you could miss one of those renames and have a weird error.
I too don't like code bases with too many files that have the same name, but the IDEs (for me at least) do a pretty good job at showing the whole path which makes it easy to spot what index file I'm after. I can even search for a file "counter" and (VS Code at least) the index file also shows up.
Ah okay, thanks for the clarification. So this is only about the setup template showcasing something which is not ideal in your opinion (which I agree with in this case btw).
Describe the problem
Describe the proposed solution
Rename the "src/lib/Counter/index.svelte" to "src/lib/Counter/Counter.svelte"
Keep the
src/routes/todos/index.svelte
as-is, that filename is used for routing.(I'd personally would split the rendering of the form of into a component, but for example-code it's easier to digest if it remains in a single file )
Alternatives considered
I've worked with vue and react codebases that worked with lots of index.ts files. When I've renamed these files to have meaningful and predictable filenames the reaction has been universally positive.
An alternative is to do nothing, the filename convention in the example does not affect how we setup a svelte-kit project.
Importance
nice to have
The text was updated successfully, but these errors were encountered: