Dominik 🔮
@tkdodo.eu
8.5K followers 420 following 1.8K posts
⚛️ Maintaining TanStack Query 🔮 https://query.gg 👨‍💻 Software Engineer @sentry.io 📚 Blog at https://tkdodo.eu 🇦🇹 Vienna, Austria 👧👦 Father of two
Posts Media Videos Starter Packs
Pinned
tkdodo.eu
📢 After more than 11 years of working at Adverity in various positions, I’ve decided to look for new challenges in 2025.

🚀 I'm excited to share that starting in January, I'll be joining the Frontend Platform Team at @sentry.io.
tkdodo.eu
Share it, share it!
Reposted by Dominik 🔮
opensourcepledge.com
A year ago, @sentry.io launched the Open Source Pledge, with one singular goal: get maintainers paid.

A key pillar of the Pledge is it’s not a “pledge”, like an IOU. Rather, to join the Pledge, members come with receipts. Here’s why.

🧵
Nasdaq Tower in Times Square NYC. 

The tower (which is covered in LEDs) reads
NASDAQ CELEBRATES ONE YEAR OF THE OPEN SOURCE PLEDGE AND THE COMPANIES WHO PAY MAINTAINERS

Below the text are all the member logos of companies who are members. The full list of member companies can be found here: https://opensourcepledge.com/members/
tkdodo.eu
does the PR look good? I mean the ts-expect-error is just nasty but I guess the plugin is just faulty?
tkdodo.eu
Where things mainly fell apart for Biome was editor integration. VsCode & IntelliJ just didn't support Biome well enough, it crashed on multiple users for no apparent reason.
tkdodo.eu
Query never used biome, sentry did, and I wasn't much involved in that.

Oxlint is very promising but the tradeoff of shimming TypeScript's internal APIs seems a bit risky.
tkdodo.eu
This is the most professionally comment I've ever made 🤪
tkdodo.eu
I guess most people write their config files in js?
tkdodo.eu
This errors in TypeScript, but works at runtime 🤷‍♂️
tkdodo.eu
If you don’t use defineConfig (which I don’t, why should I, these are just arrays) then extends doesn’t work.

what does work at runtime is:

export default [
...reactHooks.configs['recommended-latest'],
]

it just errors on type level
tkdodo.eu
I’m manually defining all rules now because the presets either don’t work or at the least have type errors. The recommended preset actually has no compiler rules and you’d need recommended-latest. I wasted over an hour on this. Not great, @no.lol FYI
{
  name: 'plugin/react-hooks',
  plugins: { 'react-hooks': reactHooks },

  rules: {
    'react-hooks/exhaustive-deps': 'error',
    'react-hooks/rules-of-hooks': 'error',
    'react-hooks/static-components': 'error',
    'react-hooks/use-memo': 'error',
    'react-hooks/component-hook-factories': 'error',
    'react-hooks/preserve-manual-memoization': 'error',
    'react-hooks/incompatible-library': 'error',
    'react-hooks/immutability': 'error',
    'react-hooks/globals': 'error',
    'react-hooks/refs': 'error',
    'react-hooks/set-state-in-effect': 'error',
    'react-hooks/error-boundaries': 'error',
    'react-hooks/purity': 'error',
    'react-hooks/set-state-in-render': 'error',
    'react-hooks/unsupported-syntax': 'error',
    'react-hooks/config': 'error',
    'react-hooks/gating': 'error',
  },
},
tkdodo.eu
how on earth is this so complicated lol
tkdodo.eu
how do I add add the preset? this doesn’t work:

extends: ['react-hooks/recommended'],
tkdodo.eu
That’s a monorepo issue. It works with `typescript.config` when installing typescript-eslint

import typescript from 'typescript-eslint'
export default typescript.config([...])

but still no dice on the config itself
tkdodo.eu
How is reactHooks imported? I get errors left and right:

import reactHooks from 'eslint-plugin-react-hooks'

{
extends: [reactHooks.configs['recommended-latest']],
},
TS2339: Property configs does not exist on type
tkdodo.eu
I’m stuck on this now:

TypeError: Key "rules": Key "react-hooks/react-compiler": Could not find "react-compiler" in plugin "react-hooks".

not sure why? This doesn’t work anymore:

'react-hooks/rules-of-hooks': 'error',
tkdodo.eu
why would I need either one? Up until now, we just return an Array: github.com/TanStack/que...
github.com
tkdodo.eu
of course AI is useless and just drops even worse suggestions all the time 🙄
tkdodo.eu
even if I 1:1 copy the eslint config as it is, it just yields “Parsing error: Unexpected token {“ on every type import 😭
tkdodo.eu
Alternating between this:

TypeError: Key "rules": Key "react-hooks/react-compiler": Could not find "react-compiler" in plugin "react-hooks".

and this:

Oops! Something went wrong! :(
A config object is using the "extends" key, which is not supported in flat config system.
tkdodo.eu
Having the _worst_ time trying to upgrade eslint-plugin-react-hooks to v6.1.1 in the Query repo. Why are the instructions for flat config so weird? What’s defineConfig? Why do I get TypeError: Unexpected array?

This shouldn’t be more complicated than adding ONE line of code to the eslint.config.js
www.npmjs.com
tkdodo.eu
we already bundle
tkdodo.eu
auto-memoization even for users who don't use the compiler on their projects