You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on the config file support in #1080, we have noticed that it would be possible (and helpful) to define the shape of the CLI options defined in src/program.js as JS object literals (which are currently using Object as their flow type, which is basically a "catch-all" which will match any object type).
What is the expected or desired behavior?
By declaring more detailed flow types for the program cli/config options, flow will be able to catch some additional classes of mistakes when we add new options or change the existent ones using the flow static analysis.
In particular the following are the lines in src/program.js which would need to switch to the new types:
Is this a feature request or a bug?
code quality improvement
What is the current behavior?
While working on the config file support in #1080, we have noticed that it would be possible (and helpful) to define the shape of the CLI options defined in src/program.js as JS object literals (which are currently using
Object
as their flow type, which is basically a "catch-all" which will match any object type).What is the expected or desired behavior?
By declaring more detailed flow types for the program cli/config options, flow will be able to catch some additional classes of mistakes when we add new options or change the existent ones using the flow static analysis.
In particular the following are the lines in src/program.js which would need to switch to the new types:
web-ext/src/program.js
Line 71 in 6af14a6
web-ext/src/program.js
Line 96 in 6af14a6
We could probably start to only enforce the presence and type of the "type" attribute on every option object, e.g.
An additional object related to the options that could use a more detailed type is the following:
web-ext/src/program.js
Line 42 in 6af14a6
Which is a map of the options by command name, and so it could be probably defined using the following flow type (or something similar to it):
The text was updated successfully, but these errors were encountered: