Configuring arrow-function style for route file auto generated code
In a monorepo I'm working in, we have the following react eslint rule set to enforce arrow-function style for react function components (https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md). When Tanstack router's auto code generation generates route file content, there's many things that can be configured looking at the configuration and the source code for the config: https://tanstack.com/router/latest/docs/framework/react/routing/installation-with-vite#configuration
Is there an existing configuration to set for this? I couldn't find any. There is a
customScaffolding
configuration which I assume could be used for this, but I'd prefer not to muck around with the default template for a small thing as such. Would it be possible to include this as a config option for the generated code?
3 Replies
deep-jade•5w ago
Sounds like it would be easier for the developer to just change the function to be an arrow function ¯\_(ツ)_/¯
absent-sapphire•5w ago
I had the same problem, here's what I did:
Not too much fiddling for me, but I'd love an option for that as well
This works fine though!
stormy-gold•5w ago
we are most likely not adding another option. instead, we will even reduce the options and improve custom scaffolding