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/

A new Intel Itanium (IA-64) emulator that boots Windows

https://raymii.org/s/blog/Intel_Itanium_IA-64-Emulator_that_boots_Windows.html
2•jandeboevrie•8m ago•1 comments

Americans are angry about data centers. Politicians are feeling the pressure

https://www.reuters.com/world/us/americans-are-angry-about-data-centers-politicians-are-feeling-p...
1•baranul•8m ago•0 comments

From Enlightenment to Alignment

https://smolnero.com/posts/from-enlightenment-to-alignment
1•andsoitis•9m ago•0 comments

Why It's So Hard to Add a Column in the Middle of a PostgreSQL Table

https://www.bytebase.com/blog/why-its-hard-to-add-a-column-in-the-middle-of-postgres-table/
1•thunderbong•12m ago•0 comments

Moore's Law for Everything

https://moores.samaltman.com/
1•dtj1123•16m ago•0 comments

I built an AI operating system after getting tired of repetitive work

https://lynx.apex7ai.com
1•levymartins•17m ago•0 comments

Data Science Weekly – Issue 660

https://datascienceweekly.substack.com/p/data-science-weekly-issue-660
1•sebg•21m ago•0 comments

Is the determinant of this "Fibonacci sum" indicator matrix always -1, 0 or 1?

https://mathoverflow.net/questions/513340/is-the-determinant-of-this-fibonacci-sum-indicator-matr...
1•philipfweiss•22m ago•0 comments

Russian drones spotted using screwed-on magnetic compasses as navigation aids

https://www.tomshardware.com/tech-industry/drones/russian-drones-spotted-using-screwed-on-magneti...
2•rmason•23m ago•1 comments

Mefo Bill

https://en.wikipedia.org/wiki/Mefo_bill
3•handfuloflight•30m ago•0 comments

How to soothe thumb pain when texting and scrolling

https://apnews.com/article/trigger-thumb-de-quervains-tenosynovitis-carpal-tunnel-35728b0142d310c...
3•devonnull•31m ago•0 comments

Tine: A new editor for Jai, Zig and C++

https://travisdp.itch.io/tine
1•travismd•32m ago•0 comments

Heavy TV watching associated with smaller brain structures, study finds

https://dornsife.usc.edu/news/stories/heavy-tv-watching-associated-with-smaller-brain-structures/
36•mashally•32m ago•4 comments

Wall of Optimism – I have reasons to believe the future is beautiful, and you?

https://wallofoptimism.com
2•nikitafaesch•36m ago•0 comments

Can LLMs write Base64 as well as they read it?

https://arvidsu.github.io/encode_bench/index.html
2•ArvidSu•38m ago•0 comments

HMD Fusion easy to repair smartphone

https://www.hmd.com/en_int/hmd-fusion
2•savolai•39m ago•1 comments

Show HN: A schema you change by talking to it, without the model writing SQL

https://github.com/leandrobon/mutable-crm
2•leandrobon•40m ago•0 comments

Prime Flow Field Background Animation

https://www.brt.fyi/posts/prime-flow-field/
4•maxbrt•43m ago•0 comments

Is someone Into process mining? Let's talk in this thread

1•FrancescoMassa•46m ago•0 comments

The Windows laptop market is so bad I'm considering a MacBook

https://old.reddit.com/r/laptops/comments/1uy4hj0/ive_officially_hit_rock_bottom_the_windows_laptop/
3•ksec•48m ago•0 comments

Eric Schmidt tried to convert Google to Java

https://www.youtube.com/watch?v=ceCy2_FRxxo
5•mashally•49m ago•1 comments

Barbarians at the Gateways (2013)

https://spawn-queue.acm.org/doi/10.1145/2523426.2536492
2•tosh•57m ago•0 comments

Pyinfra Is Underrated

https://pyinfra.com
5•zxspectrumk48•1h ago•0 comments

Why Argentina Has Almost No Black People [video]

https://www.youtube.com/watch?v=FiPSZ_eaRPo
6•baranul•1h ago•0 comments

Trend Has Russian Men Smashing Their iPhones for a Manlier Look

https://www.odditycentral.com/videos/bizarre-trend-has-russian-men-smashing-their-iphones-for-a-m...
11•jethronethro•1h ago•1 comments

On Claude's Clotted Writing Style

https://blog.kierangill.xyz/clotted-claude
3•kierangill•1h ago•0 comments

The Newest Vegas Loop Stations Will Blow Your Mind [video]

https://www.youtube.com/watch?v=e7vFCP3PtuA
2•Topfi•1h ago•0 comments

Nvidia DGX Spark as a daily driver

https://daniel.lawrence.lu/blog/2026-07-15-dgx-spark-as-daily-driver/
5•plun9•1h ago•1 comments

Photo going viral of Lionel Messi with baby Lamine Yamal(2024)

https://www.euronews.com/culture/2024/07/16/two-legends-the-story-behind-the-2007-photo-going-vir...
2•rawgabbit•1h ago•1 comments

Wigolo: Local first web search agent

https://knockoutez.github.io/wigolo/
2•handfuloflight•1h ago•0 comments