types: Correct outdated imports in jsx-runtime by rschristian · Pull Request #4981 · preactjs/preact (original) (raw)

Closes #4980

The actual fix was straightforward, only touching /jsx-runtime/src/index.d.ts, but the linting fix was more involved.

Whilst we have a linter that should've caught that problem, turns out we had skipLibCheck: true enabled -- this skips checking for source .d.ts files as well as those in node_modules. Removing this immediately caused issues however as vite and vitest require more modern TS setups.

As such, the jsconfig-lint.json got a bit of a facelift to make it more modern & compatible, whilst also removing the skipLibCheck setting so that we now get warned of type errors again. Yay.

Re: compat/server.d.ts, no idea what to do about that one. TS is grumpy about the mixed exports (rightfully so) and I spent an hour trying various ways to get around it with no luck. It works at runtime for consumers, so I just silenced the errors. We know that's a problem with our types anyhow (ESM-only anyone??)