Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-export-from should not report when casting the type #1579

Closed
pcorpet opened this issue Nov 8, 2021 · 1 comment · Fixed by #1580
Closed

prefer-export-from should not report when casting the type #1579

pcorpet opened this issue Nov 8, 2021 · 1 comment · Fixed by #1580
Assignees
Labels

Comments

@pcorpet
Copy link

pcorpet commented Nov 8, 2021

When enabling the prefer-export-from I get a warning on a valid case: type casting.

For instance in my app I want modules to use my version of redux' useDispatch as I've enforced a different type (narrower).

import {useDispatch as reduxUseDispatch} from 'react-redux'
type MyDispatchType = Dispatch<MyActions>

export const useDispatch: () => DispatchAllActions = reduxUseDispatch

As of v38.0.0, eslint would complain on the last line although it's not equivalent to an export from statement.

@fisker
Copy link
Collaborator

fisker commented Nov 8, 2021

#1580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants