vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Fix: eslint warning in code example from the documentation: void is not valid as a constituent in a union type

Open Josef-Friedrich opened this issue 5 months ago • 2 comments

eslint@typescript-eslint/no-invalid-void-type

Description

When I copy the example from the documentation into my project, these warnings appear:

void is not valid as a constituent in a union type eslint@typescript-eslint/no-invalid-void-type

Using undefined instead of void will fix this problem

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • [ ] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • [ ] Ideally, include a test that fails without this PR but passes with it.
  • [ ] Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • [ ] Run the tests with pnpm test:ci.

Documentation

  • [ ] If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • [ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Josef-Friedrich avatar Mar 11 '24 21:03 Josef-Friedrich