Skip to content

Line endings in route files are changed when using tab indentation #7163

Description

@DeadRobotDev

Which project does this relate to?

Router

Describe the bug

After saving, the line ending is changed from 'lf' to 'crlf', with trailing ^M on each line.

Your Example Website or App

https://github.com/TanStack/router/tree/main/examples/react/basic-file-based

Steps to Reproduce the Bug or Issue

  1. Start pnpm dev.
  2. Change indentation of ); line to tab:
import { createFileRoute } from '@tanstack/react-router';

export const Route = createFileRoute({
  component: App,
});

function App() {
  return (
    <>
      <p>Hello, world!</p>
    </>
	); // This line
}
  1. Remove the ('/'), or rename the file.
  2. Reload the file.

Expected behavior

It should just update ('/').

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.168.18
  • OS: Windows
  • Bundler: Vite
  • Bundler Version: 8.0.8

Additional context

This doesn't occur if you remove the ; from the tab indented line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions