Create git-ignored playground files in your project - a podcast by Kent C. Dodds

from 2021-03-22T23:01:09

:: ::

So one thing that I do, you know, how you like you do something just you've
done it forever and then when you show it to somebody they're like blown
away like, oh man, what a good idea, whatever nobody is said that to me onthis one but I thought I'd be one of those things that um that I just do it
naturally in and you might find it to be useful so in my global git ignorefor my machine.
I have a pattern for ignoring anything that includes the text dot ignoreddot and and so then I can create a folder.That's like temp dot ignored dot
staff or more often I'll create a file that's like temp dot ignored dot js
and what this allows me to do is I create a file like that within myproject that I just want to play around with stuff and I don't want to have
to install all the same dependencies in a different project or whatever andI don't want to mess up the other files that I have in my project and then
I can mess around with things and I do this a lot for interacting withthird-party APIs, I'm just trying to learn about like what's the code that
I need to write to consume?This API and transform it into whatever I need it to be and then forward
that on to the rest of my my code base and and then adding types to it andeverything and so yeah just having the ability to quickly create little
files that will be ignored by git is really quite useful and and fileswithin the project so I can import other files and things and if I want to
write it all in typescript then I can use TS node to run it but normally Ijust do it in JavaScript because often script.
Just kind of in the way there especially since I configure type script tobe unstrict mode and everything I'm just rapidly iterating over some code
and then when I'm all done with that, I can copy it into where it should be
in my project and add types to it and everything like that so anyway.I think that it can be useful to have a little kind of a playground sort of
area for you to to experiment with different ideas and stuff if you want totake it to the next level there's quokka by Wallaby JS and I do have quokka
and I use that sometimes but what I'm interacting with third-party APIs, I
want.To be explicit about when I'm rerunning the code and so yeah having just a
separate file for that can be quite useful. I've done this for years and
maybe that'll be interesting or useful to you hope you have a great day bye.

Further episodes of 3 Minutes with Kent

Further podcasts by Kent C. Dodds

Website of Kent C. Dodds