So that's writing tests in Dino, really not much to it. Yeah, so now we have tests, let's do some of the things which you probably want to do for your library project. You want to check that formatting's correct, ensure that there's a consistent formatting across the project, and also across all of your projects. For that, you can use dino fmt. dino fmt is another subcommand that you can run, and it formats all of your files. So if I mess up the styling here, let's add some spaces, and like, this is very ugly, right? Run dino fmt, it all snaps it back into place to make it look good.
And this is also integrated right into VS Code, so if I mess this up again, right, oh, and, hello, and then right-click and click format document, it'll fix this all up. And I also have format on save enabled, so I can also just press Control-S, and it'll also format. And the formatter works for not just TypeScript, but it also works for JavaScript, Markdown, JSON, and various other things.
Dino also has a built-in linter. So formatting is for styling, and linting is for logic errors. So if you have logic errors in your code, we can also find those. So sometimes, for example, you might accidentally write, if false console.log hello, this console.log hello can never happen, because false, like if false, can never happen, right? False, you're like, you're comparing to a constant expression here. False. And, you know, lint will catch this, and it'll say, use for constant expression as a condition is not allowed, remove this constant expression. And I can also check this in CI or from my shell with the dno lint sub command, and it'll tell me the same thing, and it'll give me more information to where I can, or it'll give me a link to where I can find more information. So that's formatting and linting.
Then you probably want to publish your code for dno users, not just node users, which we're going to look into later, but also dno users. To do that, you can actually publish it to just any web server. So dno imports its code, as you saw here, just from URLs, so you can host code anywhere. We do provide a module registry called dno.land.x, which has some nice guarantees, like it's immutable, people can't change the code after they've uploaded it, and it hooks right into your existing GitHub flow. But yeah, you can host your code wherever you want. If you want to learn more about dno.land.x, you can hit go to dno.land.x. But I've already published this module, so let's look at that real quick. dno.land.x.greeter. You can see our mod.ts, our readme, our tests. And yeah, so it's published. I told you about this documentation generation, so that's also directly integrated into dno.land.x or any website you want. You can go to dnoc.dno.land, enter a URL, and get documentation for it. Or if you're in dno.land.x, you can just hit the documentation button on the right hand side of any module, and then it'll show you the documentation.
Comments