andreypopp / validated

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

the published npm package does not contain the .flowconfig file #5

Closed vicapow closed 7 years ago

vicapow commented 7 years ago

To reproduce:

npm install validated --save
ls -al node_modules/validated/
.            README.md    lib          package.json schema.js
..           json5.js     object.js    repr.js
andreypopp commented 7 years ago

It shouldn't contain it. What's the issue?

vicapow commented 7 years ago

This maybe be a misunderstanding on my part of how .flowconfigs are supposed to work but I was getting this error whenever I tried to integrate the project:

node_modules/validated/lib/schema.js.flow:192
192:       return value;
                  ^^^^^ mixed. This type is incompatible with
175: export class ConstantNode<V> extends Node<V> {
                  ^^^^^^^^^^^^ some incompatible instantiation of `V`

Looking at node_modules/validated/lib/schema.js.flow:192

  // $FlowIssue: not a flow issue really, but we need to propagate type info
  return value;

But when I checked your .flowconfig on github I saw:

suppress_comment=\\(.\\|\n\\)*\\$FlowIssue

So I figured it must have had to do with the missing .flowconfig in the published npm package.

andreypopp commented 7 years ago

Got it. I should of think of a better way to ship typings with the library. In the meantime you can add a suppress_comment config like in validated's .flowconfig.

vicapow commented 7 years ago

that solved the issue for me. thanks!

andreypopp commented 7 years ago

Ok, 0.8.2 shouldn't require custom .flowconfig anymore.