Skip to content

Too many index.svelte files in SvelteKit demo app #1874

Closed
@bfanger

Description

@bfanger

Describe the problem

  • "index" does not describe the component
  • Showing the filename in the editor tab is no longer enough
  • Automatic importing gets unnecessary complicated (does't work)
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions