facebookarchive / redux-react-hook

React Hook for accessing state and dispatch from a Redux store
MIT License
2.16k stars 103 forks source link

Flow error: Redundant argument. This argument doesn't change any lint settings. #57

Closed osmestad closed 5 years ago

osmestad commented 5 years ago

When trying to upgrade to latest version of this library (3.3.2 from 3.2.1) I get Flow failures for both the usages of: // flowlint-next-line unclear-type: off indist/index.js.flow The error is: Redundant argument. This argument doesn't change any lint settings. Happens when using Flow 0.100.0

ianobermiller commented 5 years ago

You can fix this by adding the following to your .flowconfig:

[strict]
unclear-type

At Facebook, ours looks like this:

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

Read more about @flow strict and @flow strict-local here: https://flow.org/en/docs/strict/.

If it would help, I can add these changes just locally in the FB codebase and remove them from the public definitions. What do you think?

osmestad commented 5 years ago

Thanks! Adding a [strict] block to our .flowconfig solves it for us. I think this should probably be considered a bug in Flow though, as I think it should not report this error for library dependencies? So maybe we should open an issue there? (I did not find any similar issue there)

osmestad commented 5 years ago

In theory I thought it should be possible to avoid the error by having a section like this in .flowconfig:

[declarations]
.*/node_modules/.*

But that does not seem to work for me.