Error: You have both a tsconfig.json and a jsconfig.json.
Error: You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.
But I'm not using Typescript 🤨
I need a tsconfig.json, because I need eslint-plugin-deprecation, which requires @typescript-eslint/parser, which requires Typescript, which requires a tsconfig.json.
When I rename tsconfig.json to tsconfig.eslint.json and point eslint to that, craco conveniently creates a tsconfig.json! 🤯
It does so because it detected one little teeny-weeny .ts file, which again is needed for a valid tsconfig.json. The file doesn't even contain any code whatsoever, just a comment to explain to developers encountering it, what it's for.
The build will succeed (well, not really, as it builds some empty project, but at least without errors), but only this time. Next time it'll see that newly-created tsconfig.json, which will produce the same error again. This is madness! Craco literally conveniences itself to a crash 😅
So how can I:
- Prevent it from creating a
tsconfig.jsonfor a Javascript project - Tell it not to crash on the existence of a
tsconfig.jsonand ajsconfig.json, but instead usejsconfig.jsonand ignore the other - Work around this issue until a proper fix has been released
Are you sure this is coming from CRACO and not CRA itself? I remember setting up CRA in a project with both tsconfig.json and jsconfig.json and CRA threw out an error until I removed one of those files.
Does it matter? I'm using craco, not cra, and to me craco is throwing this error. Whether the error originates in an upstream package, I trust that the craco authors know how to deal with better than I do.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Close this issue all you want, but I don't think this issue is fixed. I'm no longer on the project that this was about, so I personally don't care if it get fixed. But it probably should be.
At any rate, I really don't think ingoring/postponing an issue merits closing it...
Stale bot closed this issue for inactivity. Because I'm starting to maintain this project and because I'm personally not a fan of stale bot (at least for now when I can manually close issues as I see necessary), I'll remove it. I'll look into the issue at some point soon.
Does it matter? I'm using craco, not cra, and to me craco is throwing this error. Whether the error originates in an upstream package, I trust that the craco authors know how to deal with better than I do.
@thany if you're using craco, you're probably using cra (hence the 'cra' in 'craco'). In fact, there's no point in using craco if you're not using create-react-app.
The error that you encountered is not thrown by craco but is instead thrown by react-scripts. If you could, please share the steps you took so I can try to reproduce the issue (for example, you could create a demo repo with the setup you have).