-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
This is currently just a dummy PR to outline the main points needed to be implemented. I may or may not find time to actually work on it this weekend, I'll probably finalize #67 first, and I have a few other things I want to work on as well. |
774f405
to
6cd11e1
Compare
Proof of concept for the shortened commands + probably even the final implementation of it implemented @mxstbr @ismay. It would be way overkill using a trie or something with better complexity when we'll only have 10 commands or something like that to check against, so I think this should work just fine, right? :) |
b3a84f9
to
b4d2595
Compare
Okay, we're nearly there! I just need a tiny bit of feedback, specifically concerning the handling of whitespacee in the comments of #87, and then I'd also like to hear your opinion on what we should do if someone writes an invalid tag, as for example I think I prefer the first with letting them know as the fact they prefix with Other than that I just need to polish a bit of code, polish / add a few more tests, and update the README. EDIT: |
Hmm, not sure. As in an actual error or a stylelint error? |
Yeah that's also a relevant question which my initial thought at least was to throw a real error, because I thought it was a bit weird making custom stylelint errors, but maybe that could actually work I guess. We could call the rule |
If you make it a custom stylelint rule it'd be something we could probably neatly solve by including it in stylelint-config-styled-components-processor |
Yeah that'd be one way. I feel like it would create a bit of a dangerous possible mismatch between versions though, it would be a very strong peerDependency anyway in terms of if the API changes we need to change the rule. The other way I thought was to maybe to inject a stylelint error if we went down the stylelint error path. I'm not sure exactly how you would inject it but I'd hope it was possible before the final part where we were previously removing errors from the result (before we had the config repo), though that would of course definitely be possible. |
That's true. Although in the worst case scenario it'd be false positives, or it not warning when it should (if you allow the processor to just fail silently).
That should be possible. But I'd prefer not to rely on the internal structure of the stylelintResult. I'd say that if we want it to be reported through stylelint we should do it with a rule. But yeah, that also has its downsides (as you say, the rule could change for example). Another way would be to throw an error from our processor, but I don't know how stylelint would handle that (if it would crash, or something else). |
Yeah that was my initial idea, and I assumed it would crash, which as I said:
And I therefore thought that justified crashing stylelint? But yeah, as we both agree there are ups and downs of the different choices, and throwing an error I guess could also do something else than crash stylelint? Though I would be surprised and can't imagine what it would do then. |
Hmm yeah. I think all things considered I'd then also prefer throwing an error from our processor. One thing I am worried about is whether editors with stylelint linters will restart stylelint when it crashes, but that maybe isn't really our concern. It seems like the best first option, and we could always adapt it should it not work as expected. |
Can't wait to land this! Let's put docs into the README for now, then write and publish an article, release 1.0 sometime this week and then work on moving the docs? |
Yeah I think that's probably the main point. Let's start out with throwing an error, and if it screws with editors (which is a very valid point) we can adapt it. Maybe use the rule or something of the like. |
Sounds like a plan :). The final feedback I need from you guys is just regarding my last comment in #87, as I think we settled the error thing for now. And then I'll try and make some time in the next few days to finish up this PR :). |
074ef4a
to
acf6499
Compare
Woot woot, I think I'm done! I'm pretty happy with it now :). I'll just work on the README now and maybe do a bit of squashing of commits for nicer history, and I'm ready for review and merge to our v1.0 branch :). |
46ad7c8
to
7c2961b
Compare
Just finished now, you can add it now if you want and I can squash it again? Also feel free to take some more time to give the whole thing another review if you want @ismay |
Ok done. It's a supertiny fix, but anyway :). Other than that no remarks 👍 |
848af83
to
86b660f
Compare
Yep and I just squashed that one in as well :). So let's wait for the CI to pass and then merge it in :) |
This feature should provide the tools to close #54, fix #34, and resolve #13.
The feature to be implemented in this PR is the one discussed in #68. And I will open another discussion issue later to talk about how the final API should look like and edit it in here.
The main points needed to be implemented for the full feature is: