-
Notifications
You must be signed in to change notification settings - Fork 990
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
Scaffold breaks with some custom Prettier configs #3027
Comments
fwiw even after reverting to single-quotes to fix this, the generator also removes the |
Don't be worried at all, you already did some great investigative work here! And even provided all the right links so that readers like me could get all the context they needed in no time 🚀 I don't think your fix is unreasonable at all—it's an import, and that's always going to have single or double quotes right?
This is a totally valid concern, and the code powering our generators definitely has a lot of technical debt. It's way overdue for a refactor. I'm not sure when we'll exactly get around to it; there's a lot of features we want to add, mainly customizability. I wouldn't worry about possible bugs that may be lurking and haven't reared their head yet (that's something we'll be 100% focused on during the v1 rc). Reporting issues just like you're doing is already more than enough! Also the issue about linting you mentioned sounds similar to #1551. |
👍 always trying to be a good open source citizen and come in with a bit of understanding for the problem I'm reporting. I'll get a PR open for that regex swap and pray I don't awaken any undisturbed monsters lurking in the generators. |
#2609 changed
scaffold.js
to resolve #2546. Part of that change is detecting whetherSet
is already imported intoRoutes.{tsx|ts|js}
. It does this using a regex over the file here:However #351 added in support for custom
prettier
configs. With the default settings, this all works fine. But, if you prefer"
to'
and enforce that with prettier usingsingleQuote: false,
, then this causes the regex to fail because it has a hard-coded expectation for'
.It's possible the fix here is as simple as changing the two
'
in the regex to('|")
, but I am worried I'm being naive because I'm still getting used to the Redwood ecosystem. I also worry that even if that simple solution works in this case that there might be other issues lurking in the generators that assume a code-style that may no longer actually be enforced.The text was updated successfully, but these errors were encountered: