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: Add plugin for React router 7 framework mode #931

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lasseklovstad
Copy link

Hi, I was hoping to add support for React Router 7 framework mode 😄 I have tried my best to implement a plugin based on the docs. In React Router 7 the routes.ts file defines all the routes so I map over every route entry and their children, I think this is the correct way to do it. This plugin should also handle only js files aswell.

If you use react router as library mode (only having react-router as dependency) the plugin should not be enabled. So I only enabled it when @react-router/dev is present.

I was a bit unsure what to include in packages/knip/fixtures/plugins/react-router/** directory. I asumed that I only include mock files to be used when running the tests, so I omited the vite config for instance.

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.

1 participant