esprima icon indicating copy to clipboard operation
esprima copied to clipboard

RegexLiteral source - invalid Type Object syntax?

Open OndrejSpanel opened this issue 6 years ago • 0 comments

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.

OndrejSpanel avatar Dec 27 '19 10:12 OndrejSpanel