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

no-cycle should accept Flow "typeof" imports, just like "type" #2607

Closed
gnprice opened this issue Nov 30, 2022 · 0 comments · Fixed by #2608
Closed

no-cycle should accept Flow "typeof" imports, just like "type" #2607

gnprice opened this issue Nov 30, 2022 · 0 comments · Fixed by #2608

Comments

@gnprice
Copy link
Contributor

gnprice commented Nov 30, 2022

This is an extension of #1098 / #1343. In addition to import type, Flow has a syntax import typeof. For example (try-flow link):

import typeof { useEffect } from 'react';

var f: useEffect; // has the same type as React.useEffect

Like with import type, these imports are transpiled away and have no effect at runtime, so they should be given the same treatment as import type: that is, they should be ignored.

Currently they're not.

I have a fix which I'll send in a bit.

gnprice added a commit to gnprice/eslint-plugin-import that referenced this issue Nov 30, 2022
gnprice added a commit to gnprice/eslint-plugin-import that referenced this issue Nov 30, 2022
@ljharb ljharb closed this as completed in 5a37196 Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant