reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.94k stars 15.27k forks source link

Add a note to ignore `@typescript-eslint/ban-types` rule when typing middlewares #4691

Closed renchap closed 8 months ago

renchap commented 8 months ago

PR Type

Update an existing page

Checklist

What docs page is being added or updated?

For Updating Existing Content

What updates should be made to the page?

This adds a warning to the docs because a very commonly used ESLint rule (@typescript-eslint/ban-types) will recommend switching the {} dispatch argument for Middleware to something else (likeRecord<string, never>), which will then break the store's types. As per the discussion linked above, the rule should be ignored for this line and you *need* to use{}` here.

Do these updates change any of the assumptions or target audience? If so, how do they change?

This might add an information not useful to some readers, but this page is for Typescript users, and typing middlewares is not very common, so the audience for this part should already be targeted, and there is a high probability of them using typescript-eslint

codesandbox-ci[bot] commented 8 months ago

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.

netlify[bot] commented 8 months ago

Deploy Preview for redux-docs ready!

Name Link
Latest commit bf9193e7bc6b4023b139c7c28b0b9964fc7a0381
Latest deploy log https://app.netlify.com/sites/redux-docs/deploys/6607348e63a8cc0008131021
Deploy Preview https://deploy-preview-4691--redux-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

EskiMojo14 commented 8 months ago

thanks!