DEV Community

Henrique Leite
Henrique Leite

Posted on

TypeScript dev tools in the Golang world

One of the biggest advantages of TypeScript is the size of its community.

Lots of people use the language and want to use it a lot more, because of this the TypeScript ecosystem has an amazingly large number of tools to help development in the day-to-day, which makes it a hard decision to change from TypeScript to another language that doesn't have this kind of support.

In this article, we will see how to replace some of the principal tools used in TypeScript for tools in the Golang world (but some of them can be used in other "languages" too!).

Basic: Native to the language

Golang is a language that is extremely complete from its base, so the following tools are already in the language by default:

  • TypeScript (typing system)
  • Webpack (compiler / minifier)
  • Eslint (linter)
  • Prettier (code beautifier)
  • Jest (testing tool)
  • NVM (tell which language version the project should use)
  • NPM / Yarn / PNPM (package manager)

By simply using Golang instead of TypeScript, we can already scrap 7 external "dev dependencies" from our project.

Other tools

Handling migrations

Since we are speaking only about DEV tools, I'll not focus on ORMs, things to use to access databases, and things like that, I'll only focus on the migrations.

On TypeScript, we have a bunch of ORMs that create databases for us. My favorite one for now is Prisma, which lets you create a prisma.schema file and generate migrations to keep your database synchronized.

For our luck, Prisma also has a Golang cli, so you can use it straight up.

Git Hooks (Husky)

Just use git hooks. They are already there, and are extremely simple to use, so why add another dependency to your project?

Run scripts

With npm, yarn, and other package managers, we can specify scripts on our package.json file and execute them very easily.

In Golang, we don't have this option, but we can use another tool that is language-agnostic: Makefiles.

Conclusion

I hope that this article helps you to see that TypeScript is not that special after all: Most of the things that TypeScript has also exist in other languages (but the TypeScript community is still pretty amazing too).

If you have other tool suggestions, please leave them below so we can know about them too!

Top comments (0)