Closed pigulla closed 7 years ago
Catharsis always accepts these type unions as valid because Closure Compiler does, too. Similarly, both Catharsis and Closure Compiler allow the nullable (?
) and non-nullable (!
) operators to be used in postfix form (for example, string!
). See #20 for more background.
That said, I'm open to adding a new option (perhaps called strict
) that only accepts the documented syntax for type expressions. I can imagine how that might be useful for a style-checking tool.
I probably won't implement this anytime soon, but I'd welcome a pull request for the feature.
Closing this due to lack of interest.
Unless the
jsdoc
option is set, the following code should throw an exception because the type expressionnull|function
is invalid (type unions must be within parentheses):As I understand it, this behaviour was introduced in #8.