Documentation: fix linter errors with TypeScript declarations in Vitest setup instructions#696
Documentation: fix linter errors with TypeScript declarations in Vitest setup instructions#696keeganwitt merged 1 commit intojest-community:mainfrom MaddyGuthridge:patch-1
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 75 75
Lines 829 829
Branches 258 258
=========================================
Hits 829 829 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I don't have any Vitest experience. Is this still correct? I couldn't find any examples of folks doing it this way (https://github.com/search?q=%22extends+CustomMatchers%3CT+%3D+any%22&type=code). |
|
@keeganwitt that's how I'm doing it in my projects. Without the The reason the search turns up no results is because you've got a typo in your search query. You're hunting for |
ESLint gives a `no-undef` error without the `<T = any>` constraint in the type definition. This PR adds the constraint to help prevent people from getting linting errors from the configuration.
|
Thanks for the PR! And thanks for clarifying. |
ESLint (with the
typescript-eslintplugin) gives ano-undeferror without the<T = any>constraint in the type definitions. This PR adds the constraint to help prevent people from getting linting errors from the configuration. TypeScript doesn't seem to be fussed either way, but this should save people a minor annoyance.What
Add type variable to TypeScript + Vitest setup instructions in the documentation.
Why
Prevent minor annoyances when linting fails for people who use the definitions.