Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router-generator): add a biome-ignore comment on the generated route-tree file #1496

Closed
wants to merge 4 commits into from

Conversation

k35o
Copy link

@k35o k35o commented Apr 20, 2024

Errors do occur in routeTree.gen.ts in projects that use biome to check code.
I would like to ignore the errors in the generated files as well as in the response to eslint.

Copy link

nx-cloud bot commented Apr 20, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9b8f97f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@SeanCassiere
Copy link
Contributor

@k35o can you please update the test snapshots in packages/router-generator/tests/generator/**/routeTree.expected.ts with the new line being added in.

@SeanCassiere SeanCassiere changed the title Add a comment to routeTree.gen.ts to ignore biome feat(router-generator): add a biome-ignore comment on the generated route-tree file Apr 20, 2024
@k35o
Copy link
Author

k35o commented Apr 20, 2024

@SeanCassiere
Thank you! I update it!

@schiller-manuel
Copy link
Contributor

schiller-manuel commented Apr 20, 2024

instead of adding each possible ignore instruction separately, I would rather add a possibility to let the user customize the header.

either by supplying a file path that should be used as header or as a string that will be put on top of the generated file

@SeanCassiere
Copy link
Contributor

@schiller-manuel an array of strings would probably make the most sense.

Also, this change would require the ability to both prepend and append to the file in that case, since some tools have their comments set up in a way to pause tracking and resume tracking.

@SeanCassiere
Copy link
Contributor

@schiller-manuel PR is up!

#1502

@SeanCassiere
Copy link
Contributor

Superseded by #1502.

@k35o thank you for your contribution which led to a user-customizable feature being added in #1502.

You can upgrade the router-generator to version 1.30.0 and configure the header content of the generated route-tree file using the routeTreeFileHeader field (see documentation here: https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing#options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants