You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be wrong, but I think this is actually a bug with TypeScript. I saved your example into both a .js and a .ts file and ran the following:
As you can see both node and tsc (typescript) generate expected errors, but when typescript is parsing it as javascript it ignores the error. The output of tsc is as follows:
var a = "abc".replace(new RegExp("abc", "g"));
Since VSCode's diagnostics for JS are based on the TypeScript Server I feel that the EcmaScript5 mode of TypeScript doesn't see this as a problem because it just compiles the trailing parameter away.
There's an open Issue in the typescript project for TS to support trailing parameter lists Microsoft/TypeScript#7279
Steps to Reproduce:
var a = "abc".replace(new RegExp("abc", "g"), );
Expected: A warning that something should be between the comma and parentheses at the end
The text was updated successfully, but these errors were encountered: