esprima
esprima copied to clipboard
RegexLiteral source - invalid Type Object syntax?
I think following line is not a valid TypeScript:
https://github.com/jquery/esprima/blob/a971d877fe7af52d5518d25a758835dc51cd7dbe/src/nodes.ts#L632
I think a semicolon should be used instead:
readonly regex: { pattern: string; flags: string };
See Object Types.
The TS compiler seems to accept the code without any warnings. Perhaps I am wrong and this is not an object type, but I cannot see what else it could be.