Report & generate missing type constraint in variable
block
#1476
Labels
diagnostics
enhancement
New feature or request
textDocument/codeAction
textDocument/publishDiagnostics
Context
Users may - and anecdotally often do - write configuration without considering the type of variables, for example:
Sometimes they go one step further but still not very far by defining the type as
any
:or they may let the type to be inferred from the default value, e.g.
In all these cases, they can introduce bugs due to type mismatches/conversions or at least make it much more difficult for collaborators and consumers of the module to understand the module as a whole.
Proposal
type
constraint as a warning diagnostic, suggesting that types are better declared explicitly to communicate intentionstype = any
as informal diagnostic, suggesting more concrete type, to communicate intentionsquickfix
code action to generatetype
based ondefault
valueThe text was updated successfully, but these errors were encountered: