frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Automatically add missing "async/await" keywords to your TypeScript code

https://github.com/stanNthe5/typescript-autoawait
7•theThree•1y ago

Comments

bastawhiz•1y ago
Is this a problem that people actually have?
xeromal•1y ago
Fun side project man!
primitivesuave•1y ago
I took a peek at the implementation - I think this only works for a case where the typing explicitly contains the string "Promise". For example, I don't think it would work if I use `SomeInterface["some_promise_key"]` or might incorrectly add an async if I use `Awaited<Promise<...>>`.

I think what you're trying to build might be best served by Typescript's VFS - https://www.npmjs.com/package/@typescript/vfs. You can load the local files into an in-memory type system, and quickly extract async/await hints that might be more useful for a typical TS developer. I think there's a lot of really interesting static analysis you could do to improve async/await safety, as it certainly leads to issues from time to time.

joshstrange•1y ago
I do not want to be mean but I think you'd be much better served with ESLint rules to yell at you when you don't await when you should or do when you shouldn't.

This should _not_ be an automatic operation since it can change behavior in ways that will be unclear to the developer (completely undoing any gain from them being added automatically).

theThree•1y ago
You can still control it by adding "//no-await". In fact, the "//no-await" makes me feel more clear.
nextweek2•1y ago
I created a ticket, using comments is not necessary because there is already the `void` syntax for when you don't want to wait:

https://github.com/stanNthe5/typescript-autoawait/issues/1

nextweek2•1y ago
It should be noted that there is already a lint rule for this: https://typescript-eslint.io/rules/no-floating-promises/

I was wrong about the Midjourney ultra-sound scanner

https://twitter.com/MattZirwas/status/2068365802491834541
1•MrBuddyCasino•58s ago•0 comments

Backtest Is Lying to You

https://moai.studio/blog/posts/your-backtest-is-lying.html
2•ionwake•1m ago•0 comments

How to Build a Marketplace Startup That Solves the Chicken-and-Egg Problem

https://startupfortune.com/how-to-build-a-marketplace-startup-that-solves-the-chicken-and-egg-pro...
1•insanetech•1m ago•0 comments

Why the Cookbook Endures

https://tastecooking.com/why-the-cookbook-endures/
1•Tomte•4m ago•0 comments

Electric air taxis are stuck in the courtroom

https://www.theverge.com/column/950975/electric-air-taxis-lawsuits
1•Brajeshwar•4m ago•1 comments

Backporting bug fixes is dead, Project Valkey now sends in the bots

https://thenewstack.io/valkey-ai-backporting-agents/
2•Brajeshwar•5m ago•0 comments

Linux '95

https://www.linuxjournal.com/article/2682
1•theanonymousone•5m ago•0 comments

Vulgar Materialism

https://borretti.me/article/on-vulgar-materialism
1•Tomte•5m ago•0 comments

Show HN: Teach your kids absolute (perfect) pitch

https://github.com/paytonjjones/bsharp
1•paytonjjones•6m ago•0 comments

Printing Gaussian Splats

https://www.patreon.com/DanyBittel/posts/printing-splats-161333338
1•ilnmtlbnm•7m ago•0 comments

Show HN: TermType – a terminal typing game where words fall like Space Invaders

https://github.com/GiovanniCst/termtype
3•J_cst•7m ago•0 comments

Anthropic to Require ID Verification for Certain Capabilities Starting July 8

https://old.reddit.com/r/ClaudeAI/comments/1ubm53n/official_anthropic_to_require_identity/
6•bathory•11m ago•1 comments

Why Mizoram has shops without shopkeepers (2024)

https://timesofindia.indiatimes.com/etimes/trending/why-mizoram-has-shops-without-shopkeepers/art...
1•susam•12m ago•0 comments

Show HN: A GitHub app that suggests code fixes for conversion failures

https://rejourney.co/demo/leaks
2•mrr7337•13m ago•1 comments

Smashing the NIMBYs created modern capitalism

https://worksinprogress.co/issue/how-abolishing-the-stakeholder-state-caused-the-industrial-revol...
1•momentmaker•13m ago•0 comments

Safe SIMD in Rust, Even on the Inside – By Sergey "Shnatsel" Davidoff

https://shnatsel.medium.com/safe-simd-in-rust-even-on-the-inside-c6f1ff381828
1•rbanffy•15m ago•0 comments

Why do sports stadiums have different names for the World Cup? Here's the reason

https://www.thv11.com/article/sports/soccer/world-cup/fifa-world-cup-stadiums-different-names/507...
2•RickJWagner•17m ago•0 comments

Neosolve – SolveSpace fork with OpenCASCADE CAD kernel

https://github.com/0xSeren/neosolve
1•nakedneuron•20m ago•1 comments

Creativity in the form of archived web pages from the dawn of the internet

https://www.cameronsworld.net
2•momentmaker•21m ago•0 comments

How the social media ban could reshape how all of us use the internet

https://www.bbc.co.uk/news/articles/c1jy512r19ro
2•mmarian•21m ago•0 comments

Where the sun stood at the 2026 summer solstice

https://pilgrimapp.org/sunpath/2026-summer-solstice/
1•momentmaker•22m ago•0 comments

Solvespace Web Version

http://orthogonal.cc/solvespace/solvespace.html
1•nakedneuron•22m ago•0 comments

Developer ends Fornjot (CAD kernel) development

https://www.fornjot.app/blog/shutting-down-fornjot/
1•nakedneuron•23m ago•0 comments

Ask HN: Future of Programming?

1•anujmehta•25m ago•0 comments

Pakistan: The solar revolution nobody planned

https://janrosenow.substack.com/p/pakistan-the-solar-revolution-nobody
1•leonidasrup•25m ago•0 comments

Rent Is So High, New Yorkers Are Living with Nuns

https://www.wsj.com/lifestyle/rent-is-so-high-new-yorkers-are-living-with-nuns-00dac324
1•jawns•26m ago•1 comments

Huffman tree compressor and decompressor written in Clojure

https://github.com/netb258/huffman-tree/
2•netb258•28m ago•0 comments

Masochistic YouTuber Punishes Himself by Writing a First Person Shooter in COBOL

https://gizmodo.com/masochistic-youtuber-punishes-himself-by-writing-a-first-person-shooter-entir...
3•rbanffy•29m ago•0 comments

AI Made Me Braver

https://neilkakkar.com/ai-made-me-braver.html
1•neilkakkar•29m ago•0 comments

Local Inference

https://av.codes/blog/on-local-inference/
2•everlier•29m ago•0 comments