Skip to content

chore: fix vitest type definitions#3351

Merged
dai-shi merged 5 commits intopmndrs:mainfrom
grigoriy-reshetniak:fix-vitest-type-definitions
Jan 16, 2026
Merged

chore: fix vitest type definitions#3351
dai-shi merged 5 commits intopmndrs:mainfrom
grigoriy-reshetniak:fix-vitest-type-definitions

Conversation

@grigoriy-reshetniak
Copy link
Copy Markdown
Contributor

Related Bug Reports or Discussions

Addressing one of the FIXME comments

Summary

Fixed path in tsconfig.json, setup.ts was using this declarations already.

Before

npx tsc --noEmit --skipLibCheck false returned 10 errors, 2 of them were related to jest-dom types.

After

npx tsc --noEmit --skipLibCheck false returns 8 errors, all of them related to @redux-devtools/extension.

Check List

  • pnpm run fix for formatting and linting code and docs

It seems to me that errors for @redux-devtools/extension cannot be addressed without fixes on their side.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
zustand-demo Ready Ready Preview, Comment Jan 14, 2026 1:15pm

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Jan 11, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Jan 12, 2026

@sukvvon can review quickly?

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 12, 2026

commit: cf27f81

Comment thread tsconfig.json
Comment thread docs/guides/testing.md Outdated
Comment thread docs/guides/testing.md
Comment thread tsconfig.json
@grigoriy-reshetniak
Copy link
Copy Markdown
Contributor Author

Hello @sukvvon.
Thank you for your feedback. I’ve addressed one of the comments, but I’d like to clarify another point.

skipLibCheck: true is already set, so it doesn't affect actual usage

That’s true, however this change reduces the overall number of type errors and removes vitest from the list of reasons for keeping this flag enabled. Also, I've checked link you provided and it's a basic example. I was looking for any argument in vitest issues against subpath type augmentation, but haven't found any. Also, vitest itself export augmented types, so it doesn't look to me that they discourage their usage.

If you still feel that this change should be dropped, please let me know whether you’d prefer me to adjust it or proceed in a different way.

@sukvvon
Copy link
Copy Markdown
Contributor

sukvvon commented Jan 13, 2026

@gnapse Could you clarify the intended usage for tsconfig.json types with Vitest?

The official docs show @testing-library/jest-dom (without /vitest) in tsconfig.json, while the setup file uses @testing-library/jest-dom/vitest.

However, when running npx tsc --noEmit --skipLibCheck false:

tsconfig.json types Errors
@testing-library/jest-dom 10 (8 redux-devtools + 2 jest-dom)
@testing-library/jest-dom/vitest 8 (redux-devtools only)

The 2 jest-dom errors resolved by /vitest:

  • Cannot find type definition file for 'jest'
  • Cannot find name 'expect'

Is it recommended to use /vitest subpath in tsconfig.json types as well, or should it remain as the base path?

Comment thread tsconfig.json
@gnapse
Copy link
Copy Markdown

gnapse commented Jan 13, 2026

@gnapse Could you clarify the intended usage for tsconfig.json types with Vitest?

@sukvvon not sure why you mentioned me. I have nothing to do with this, do I? Maybe a mistake while typing someone else's name?

@sukvvon
Copy link
Copy Markdown
Contributor

sukvvon commented Jan 15, 2026

Hello @sukvvon. Thank you for your feedback. I’ve addressed one of the comments, but I’d like to clarify another point.

skipLibCheck: true is already set, so it doesn't affect actual usage

That’s true, however this change reduces the overall number of type errors and removes vitest from the list of reasons for keeping this flag enabled. Also, I've checked link you provided and it's a basic example. I was looking for any argument in vitest issues against subpath type augmentation, but haven't found any. Also, vitest itself export augmented types, so it doesn't look to me that they discourage their usage.

If you still feel that this change should be dropped, please let me know whether you’d prefer me to adjust it or proceed in a different way.

@grigoriy-reshetniak Let's go with the current changes. Our goal is to reduce errors, and this PR achieves that.

@sukvvon
Copy link
Copy Markdown
Contributor

sukvvon commented Jan 15, 2026

@dai-shi 👌

@sukvvon
Copy link
Copy Markdown
Contributor

sukvvon commented Jan 15, 2026

@gnapse Could you clarify the intended usage for tsconfig.json types with Vitest?

@sukvvon not sure why you mentioned me. I have nothing to do with this, do I? Maybe a mistake while typing someone else's name?

@gnapse I mentioned you because i thought you're a jest-dom maintainer. This is about the /vitest subpath in @testing-library/jest-dom, so I thought you might have some insight. Thanks anyway.

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Jan 16, 2026

Thanks everyone.

@dai-shi dai-shi merged commit 8815101 into pmndrs:main Jan 16, 2026
33 checks passed
@grigoriy-reshetniak
Copy link
Copy Markdown
Contributor Author

grigoriy-reshetniak commented Jan 16, 2026

Thank you everyone for taking the time to look into this.

@grigoriy-reshetniak grigoriy-reshetniak deleted the fix-vitest-type-definitions branch January 16, 2026 07:47
mergify Bot added a commit to robfrank/linklift that referenced this pull request Feb 14, 2026
Bumps [zustand](https://github.com/pmndrs/zustand) from 5.0.10 to 5.0.11.
Release notes

*Sourced from [zustand's releases](https://github.com/pmndrs/zustand/releases).*

> v5.0.11
> -------
>
> This release includes small improvements in middleware thanks to contributors.
>
> What's Changed
> --------------
>
> * chore: improve typing in devtools middleware by [`@​grigoriy-reshetniak`](https://github.com/grigoriy-reshetniak) in [pmndrs/zustand#3362](https://redirect.github.com/pmndrs/zustand/pull/3362)
> * fix(persist): avoid relying on global localStorage by [`@​honuuk`](https://github.com/honuuk) in [pmndrs/zustand#3367](https://redirect.github.com/pmndrs/zustand/pull/3367)
> * fix(immer): Proper typing for immer middleware in combination with slices by [`@​wheerd`](https://github.com/wheerd) in [pmndrs/zustand#3371](https://redirect.github.com/pmndrs/zustand/pull/3371)
>
> New Contributors
> ----------------
>
> * [`@​SeongYongLee`](https://github.com/SeongYongLee) made their first contribution in [pmndrs/zustand#3355](https://redirect.github.com/pmndrs/zustand/pull/3355)
> * [`@​grigoriy-reshetniak`](https://github.com/grigoriy-reshetniak) made their first contribution in [pmndrs/zustand#3351](https://redirect.github.com/pmndrs/zustand/pull/3351)
> * [`@​DormancyWang`](https://github.com/DormancyWang) made their first contribution in [pmndrs/zustand#3363](https://redirect.github.com/pmndrs/zustand/pull/3363)
> * [`@​Ea-st-ring`](https://github.com/Ea-st-ring) made their first contribution in [pmndrs/zustand#3369](https://redirect.github.com/pmndrs/zustand/pull/3369)
> * [`@​winner07`](https://github.com/winner07) made their first contribution in [pmndrs/zustand#3373](https://redirect.github.com/pmndrs/zustand/pull/3373)
> * [`@​honuuk`](https://github.com/honuuk) made their first contribution in [pmndrs/zustand#3367](https://redirect.github.com/pmndrs/zustand/pull/3367)
> * [`@​wheerd`](https://github.com/wheerd) made their first contribution in [pmndrs/zustand#3371](https://redirect.github.com/pmndrs/zustand/pull/3371)
>
> **Full Changelog**: <pmndrs/zustand@v5.0.10...v5.0.11>


Commits

* [`99379a6`](pmndrs/zustand@99379a6) 5.0.11
* [`c81b4eb`](pmndrs/zustand@c81b4eb) chore(deps): update dev dependencies ([#3375](https://redirect.github.com/pmndrs/zustand/issues/3375))
* [`3871d53`](pmndrs/zustand@3871d53) fix(immer): Proper typing for immer middleware in combination with slices (#...
* [`9b505ac`](pmndrs/zustand@9b505ac) fix(persist): use window.localStorage as default storage reference ([#3367](https://redirect.github.com/pmndrs/zustand/issues/3367))
* [`267a57c`](pmndrs/zustand@267a57c) Update code block in tutorial-tic-tac-toe.md ([#3373](https://redirect.github.com/pmndrs/zustand/issues/3373))
* [`6813f7b`](pmndrs/zustand@6813f7b) docs: remove stray Russian comment in beginner-typescript guide ([#3369](https://redirect.github.com/pmndrs/zustand/issues/3369))
* [`d9ea330`](pmndrs/zustand@d9ea330) docs(testing): fix undefined counterStoreRef variable ([#3368](https://redirect.github.com/pmndrs/zustand/issues/3368))
* [`6e026d7`](pmndrs/zustand@6e026d7) chore: improve typing in devtools middleware ([#3362](https://redirect.github.com/pmndrs/zustand/issues/3362))
* [`e7d4593`](pmndrs/zustand@e7d4593) Revert "chore(deps): bump pmndrs/docs/.github/workflows/build.yml from 2 to 3...
* [`0f49ad8`](pmndrs/zustand@0f49ad8) chore(deps): bump pmndrs/docs/.github/workflows/build.yml from 2 to 3 ([#3364](https://redirect.github.com/pmndrs/zustand/issues/3364))
* Additional commits viewable in [compare view](pmndrs/zustand@v5.0.10...v5.0.11)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=zustand&package-manager=npm\_and\_yarn&previous-version=5.0.10&new-version=5.0.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants