-
Notifications
You must be signed in to change notification settings - Fork 61
Make -styled-mixins unique and clarify interpolation linting in readme #59
Make -styled-mixins unique and clarify interpolation linting in readme #59
Conversation
Hmm... What's up with the oneliner and the random line collections in my commit? Is that what husky was doing with the pre-commit stuff? Definitely wasn't what I was doing :P. How can I avoid that? |
Just had a bit of a think about it on the train to work again. My first thought for a quickfix would be doing this in
It's a bit of a quickfix but I guess it keeps your current approach alive? I'm guessing there isn't any smart library that could handle actually evaluating the interpolations for us? We couldn't evaluate the strings first with the actual styled library or something? Would of course be awesome but I can see it could also be a big amount of work as you'd have to parse imports etc. |
That's because of prettier. Looks like a bug. edit: Might be related to prettier/prettier#2291 |
I think so too. For now I haven't had enough time to really consider which approach would be the most maintainble, but I'm also expecting that a slight refactor to clean things up a bit would be good. I'm intending to make things a bit more modular to prevent things from getting too complex.
That might be possible in some cases, but ultimately I think it would be quite difficult. Some values would only be available at runtime if I'm not mistaken and there would probably be quite a performance hit. |
Yeah I agree to that. Could definitely make a big performance hit. It is a bit sad you can't have your interpolations linted as of right now though, I might try looking into if there is some smart library we could use to handle some of the cases as I believe most cases should be known at compile time, and maybe also looking into different approaches and get back to you here. |
Great! Thanks for taking a look at it, appreciate the help 👍 |
Yeah seems very likely this is the problem. I'll add some
No problem! I already took a bit of time to look into it now actually, and I'll be pushing up my idea of a fix + commenting my reasoning soon :). |
e985c64
to
85d24af
Compare
88f3363
to
3b11e55
Compare
3b11e55
to
2012bce
Compare
Okay, a few things:
Thoughts? :) |
Also, from my POV this is ready to merge as of now, pending your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Great work! 👌 |
Thanks! And thanks for the invite :). Look forward to working with you in my spare time :). |
Thanks for the great work so far, happy to have you on board! |
Up until now I just added a failing test for #55. It seems to be a problem with this line returning undefined on a string as opposed to a variable.
I'll probably look at it again tomorrow night after work, and see if I can also fix it, my first impression is that it's a bigger problem with the approach and that it's better to find a better approach rather than patching an edge case for another one to soon pop out, but again, I haven't looked at it that much yet.
Any advice from more seasoned contributors that know the codebase better is of course welcome, otherwise I'll look at it again tomorrow night.
(fixes #55)