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

[WIP] Do not report type imports from flow-typed packages #1060

Closed
wants to merge 1 commit into from

Conversation

tf
Copy link

@tf tf commented Apr 3, 2018

fixes #960

When importing types from packages that are defined in a file inside the flow-typed directory, prevent the named rule from reporting that the package itself does not provide an export with that name.

Currently there is support for type imports from local files. Restrict these checks to imports with relative paths.

I'm not really sure how much value checking type imports provides since, I suppose, Flow itself is already good at alerting about missing imported types. Maybe type imports should not be checked at
all? At least that appears to be the route already taken in no-extraneous-dependencies. Does the same hold for Type Scripts?

The alternative of making the named rule aware of the top level flow-typed directory feels a lot like duplicating functionality that already exists inside Flow.

When importing types from packages that are defined in a file inside
the `flow-typed` directory, prevent the `named` rule from reporting
that the package itself does not provide an export with that name.

Currently there is support for type imports from local files. Restrict
these checks to imports with relative paths.
@coveralls
Copy link

coveralls commented Apr 3, 2018

Coverage Status

Coverage increased (+0.006%) to 96.476% when pulling 16f678b on tf:ignore-type-import-from-package into ee15fa4 on benmosher:master.

@mattijsbliek
Copy link
Contributor

I think we’ve opened roughly the same pull request, you might be interested in the discussion here: #1057

@ljharb
Copy link
Member

ljharb commented Apr 10, 2018

Indeed; thanks for your contribution, but this is a duplicate of #1057.

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

Successfully merging this pull request may close these issues.

Error ESLint: <Flow-typed type definition> not found in module (import/named)
4 participants