microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Error TS2339 #631

Closed travpeck closed 6 years ago

travpeck commented 6 years ago

I am getting the error TS2339: Property 'endsWith' does not exist on type [insert a string variable here] when I build a TypeScript file using the below example:

console.log( "myString".endsWith("g") );

The TypeScript autocomplete also does not list ES6 methods (such as the above endsWith).

This error does not happen in VS Code (and the autocomplete also works correctly with ES6 methods in VS Code).

mhegazy commented 6 years ago

make sure your configuration either have --target ES6 or --lib es6, dom