andreypopp / validated

Validate your configurations with precise error messages
91 stars 14 forks source link

Flow can't infer types from schema #3

Closed mkatrenik closed 7 years ago

mkatrenik commented 7 years ago

Hi, I'm not sure where's the problem, but when I use validated in my app, flow is unable to infer types from schema, I would just get any. But when I clone this repo & run flow there - everything works. So I wonder, could be some problem in compilation during publishing to npm? Has anyone else this problem?

flow@0.33.0

andreypopp commented 7 years ago

Can you post an example schema? On Tue, 4 Oct 2016 at 21:22 martin katrenik notifications@github.com wrote:

Hi, I'm not sure where's the problem, but when I use validated in my app, flow is unable to infer types from schema, I would just get any. But when I clone this repo & run flow there - everything works. So I wonder, could be some problem in compilation during publishing to npm? Has anyone else this problem?

flow@0.33.0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andreypopp/validated/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB3goNl5BOATq4dXekgWAgI7ETO8jvlks5qwplHgaJpZM4KN_1z .

mkatrenik commented 7 years ago

Even if I'm using schema from src/__tests__/index-test.js.flow like:

  let schema = s.object({
    name: s.string,
    age: s.number,
  });

it doesn't work

mkatrenik commented 7 years ago

Also on line 22 it says "unused suppresion"

Edit: I copied code from src/__tests__/index-test.js.flow to my project

flow
andreypopp commented 7 years ago

Fixed in 0.8.1.

mkatrenik commented 7 years ago

Thanks!