Syntax seems to break when a variable is given a type and assigned to an arrow function which has a generic type and the generic type is not immediately followed by a colon (and a space or special/numeric character before the generic's type if there is one).
Not Working:
A type on the variable, and the generics of the function not having a type
A type on the variable, and the generics of the function has a type, but no space around the colon.
A type on the variable, and the generics of the function having a type with a space before the colon (my personal preference).
Unexpectedly Working [Bugs?]:
A type on the variable, and there's a colon in the function generics, but no type after the colon.
A type on the variable, and garbage following the colon in the function generics. I'm not really sure if this is a bad thing, but I am amused by it.
Working Expectedly:
A type on the variable, but there's a space after the colon in the generics and not before.
No type on the variable, but keeping the function generics.
Summary:
Overall, it seems that it is requiring that a colon come immediately after the generic type, and any following character must be non-alpha. Otherwise it seems to think that it's a JSX tag that needs to close.
It does not appear to matter what order the colon and space/no-space appear with regard to the variable's type.
Syntax seems to break when a variable is given a type and assigned to an arrow function which has a generic type and the generic type is not immediately followed by a colon (and a space or special/numeric character before the generic's type if there is one).
Not Working:
A type on the variable, and the generics of the function not having a type
A type on the variable, and the generics of the function has a type, but no space around the colon.
A type on the variable, and the generics of the function having a type with a space before the colon (my personal preference).
Unexpectedly Working [Bugs?]:
A type on the variable, and there's a colon in the function generics, but no type after the colon.
A type on the variable, and garbage following the colon in the function generics. I'm not really sure if this is a bad thing, but I am amused by it.
Working Expectedly:
A type on the variable, but there's a space after the colon in the generics and not before.
No type on the variable, but keeping the function generics.
Summary:
Overall, it seems that it is requiring that a colon come immediately after the generic type, and any following character must be non-alpha. Otherwise it seems to think that it's a JSX tag that needs to close.
It does not appear to matter what order the colon and space/no-space appear with regard to the variable's type.