Coder Social home page Coder Social logo

Comments (8)

bswan0002 avatar bswan0002 commented on May 18, 2024 1

An easy solution for this use-case would be to use prettier and configure a script to run prettier immediately following tsr generate in package.json:

"scripts": {
  "generate-and-format": "tsr generate && prettier --write 'src/[yourRoutesDirectory]/*.{js,jsx,ts,tsx}'"
}

Then any time you'd run tsr generate you can instead run npm run generate-and-format to achieve the desired formatting.

EDIT: this might be unnecessary advice. Looking at the source code schiller-manuel linked, it looks like prettier config is already honored.

from location.

tannerlinsley avatar tannerlinsley commented on May 18, 2024 1

TypeScript has no idea what file you’re in, or at least doesn’t expose it for use as a type.

from location.

tannerlinsley avatar tannerlinsley commented on May 18, 2024 1

It needs both. The path in the type is the key to getting the routes parent types.

from location.

schiller-manuel avatar schiller-manuel commented on May 18, 2024 1

#894 (released in v1.0.6) adds a configuration option for the quote style.

from location.

schiller-manuel avatar schiller-manuel commented on May 18, 2024

Currently it's hardcoded:

https://github.com/TanStack/router/blob/beta/packages/router-cli/src/generator.ts#L186-L189

But could be made configurable...

from location.

universse avatar universse commented on May 18, 2024

why is it necessary to pass path to FileRoute when path is computed from the route file path?

from location.

universse avatar universse commented on May 18, 2024

I see. I was under the impression that the type inference would come from the generated routeTree file, rather than the path that gets passed to FileRoute.

from location.

universse avatar universse commented on May 18, 2024

appreciate your fast response on this

from location.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.