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

import/named doesn't ignore Flow identifier syntax type import #1115

Closed
zeorin opened this issue Jun 6, 2018 · 1 comment · Fixed by #1106
Closed

import/named doesn't ignore Flow identifier syntax type import #1115

zeorin opened this issue Jun 6, 2018 · 1 comment · Fixed by #1106

Comments

@zeorin
Copy link

zeorin commented Jun 6, 2018

"Identifier syntax":

// @flow
import { type Dispatch } from 'redux';

Gives following error:

2:15  error    Dispatch not found in 'redux'        import/named

Whilst the "declaration syntax":

// @flow
import type { Dispatch } from 'redux';

Generates no error.

This is especially annoying for users that use the flowtype/type-import-style rule with the default setting ("identifier") and run ESLint with --fix, since that rule will automatically change the syntax, which then triggers import/named.

The point of the identifier syntax is to combine type and value imports in the same statement, e.g.

// @flow
import { configureStore, type Dispatch } from 'redux';

The docs for this rule state:

Note that type imports, as used by Flow, are always ignored.

So I think this is a bug. Can we ignore the identifier syntax for this rule also?

@rostislav-simonik
Copy link

Fixed in PR #1117

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

Successfully merging a pull request may close this issue.

3 participants