Live data from Hacker News

Starting a TypeScript Project in 2021

metachris.com

51–60 of 190 posts

Re: Starting a TypeScript Project in 2021

#51

I’m curious about the value of eslint for TypeScript. I’ve not really found myself wanting from the coverage provided by tsc.

Have you tried some of the type info based rules in typescript-eslint? They're fantastic. No floating promises, no bad templating, etc.

No but the replies here make me think I should definitely give it a go. So thanks for the info everybody!

Re: Starting a TypeScript Project in 2021

#52

At what point does the complexity outweigh the benefits? Just because someone wants to control a UI element to the nth pixel doesn't mean we should let them do that. At this point I'm thinking it might be less bandwidth, complexity, and easier to maintain to just present a web page as a giant imagemap. SVG, so it scales. With screen-ratio-based media queries rather than guessing DPI based on inaccurate factors like t…

Good luck building anything interactive this way.

Re: Starting a TypeScript Project in 2021

#53

I don't see the `node --watch bundle.ts` ? That's why most of boilerplate FAILED instead of just using Next.js. Hot reloading for both server and browser is what's important.

One thing that is often mentioned in the Node community is "let's adopt the Unix Philosophy and have one tool do one thing and one thing only."

And by being inflexible, this is one of the reasons there a bazillion tools and steps required just to have a basic project setup.

They're not using the Unix tools anyway. It's not like they're using entr and make to watch and build, but let's reinvent the wheel and use nodemon and gulp/bower/webpack/esbuild/snowpack/...

Re: Starting a TypeScript Project in 2021

#54

In 2021, I think it's safe to start a TypeScript project with Deno.

Does Deno work for frontend?

It's possible, but slightly cumbersome, to write isomorphic apps. Deno has a library that can bundle Typescript for the browser at runtime. But maybe look into Vite instead for frontend.

Re: Starting a TypeScript Project in 2021

#55

At what point does the complexity outweigh the benefits? Just because someone wants to control a UI element to the nth pixel doesn't mean we should let them do that. At this point I'm thinking it might be less bandwidth, complexity, and easier to maintain to just present a web page as a giant imagemap. SVG, so it scales. With screen-ratio-based media queries rather than guessing DPI based on inaccurate factors like t…

Seems pretty simple given it includes not only test setup and continuous integration, but also publishing to npm and documentation

Re: Starting a TypeScript Project in 2021

#56
This is the best guides on how to get started with a modern JavaScript/TypeScript I’ve ever seen.

Nice step by step, explaining what each tool does and how things work together.

I’m still leaning towards just learning Elm and give up on the JavaScript ecosystem, but an article like this gives me a little hope that at least it seem realistic to get started with TypeScript.

Re: Starting a TypeScript Project in 2021

#57

In 2021, I think it's safe to start a TypeScript project with Deno.

This!

After working with node.js for more than eight years I decided to give deno a try (https://github.com/bermi/genetic) and I’ve been gratefully surprised by the development experience.

I’m just missing a simple way to include deno code on my existing node.js and browser projects.

Re: Starting a TypeScript Project in 2021

#58

That is a lot of boilerplate and reliance on external tooling that could probably be a single bash or PowerShell script. My preferred approach is to let thy primary modules be thy commands. That way everything is tidy, documented, and clear for your users. Example: // module commandName is a module to parse a command, exclusion list, and options apart from other arguments of process.argv import commandName from "./li…

> probably be a single bash or PowerShell script

The fact that it could be either bash or PowerShell is a primary reason why this tooling is there. Bash scripts work great (I use them) if everyone coding on the project shares an operating system. Not so much once you cross that boundary.

To give a sense of the lengths the JS community goes to address these compatibility issues, consider that Yarn 2 actually implements its own shell for running `package.json` scripts in a cross-platform way.

Re: Starting a TypeScript Project in 2021

#59
post #15

Ava ( https://github.com/avajs/ava ) gets too little love from the blogging machinery. It's a breeze to use with TS, faster than Jest (YMMV of course), and I love the snapshot output over any other snapshot producing unit test tool. Use with NYC for coverage is a breeze.

Related: uvu[1] which I think is intended to be a barebones version of Ava. I like the idea of not having a big fragile graph of dependencies to be able to run some tests. Not sure if uvu is any good for Typescript though.

1: https://github.com/lukeed/uvu

Re: Starting a TypeScript Project in 2021

#60
I do this sort of thing often enough that I wrote a Yeoman generator to scaffold everything: https://github.com/xavdid/generator-xavdid

Maybe overkill, but it's saved me from having to remember which recent project to reference to remember exactly how I like eslint set up, etc. Been a very smooth experience!

Post reply on HN