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'm using TypeScript quite heavily now, and loving the static/compile-time checking that I've always felt was sorely missing with JS-based development, but I'd love even more, especially for JQuery selectors. E.g. if my .ts file is used by an .aspx or .html page I want to know when I've misspelled an ID or classname or pseudo-class in a jquery selector, or I've got the wrong syntax. I'd be happy to add this sort of thing myself (I understand it's not integral to TypeScript itself) but is there a plugin mechanism for TypeScript's static-analysis module to do this? Ideally I'd even be able to write it so that TypeScript knows the object type from a Jquery selector - e.g. if I use $("select").each((i,e)=>{ e.selectedIndex = -1 }) that should compile because the use of "select" means the element type is HTMLSelectElement.
The text was updated successfully, but these errors were encountered:
if I use $("select").each((i,e)=>{ e.selectedIndex = -1 }) that should compile because the use of "select" means the element type is HTMLSelectElement.
Ideally, there would be some string-overload of $ that indicated that. it should look something like:
I'm using TypeScript quite heavily now, and loving the static/compile-time checking that I've always felt was sorely missing with JS-based development, but I'd love even more, especially for JQuery selectors. E.g. if my .ts file is used by an .aspx or .html page I want to know when I've misspelled an ID or classname or pseudo-class in a jquery selector, or I've got the wrong syntax. I'd be happy to add this sort of thing myself (I understand it's not integral to TypeScript itself) but is there a plugin mechanism for TypeScript's static-analysis module to do this? Ideally I'd even be able to write it so that TypeScript knows the object type from a Jquery selector - e.g. if I use $("select").each((i,e)=>{ e.selectedIndex = -1 }) that should compile because the use of "select" means the element type is HTMLSelectElement.
The text was updated successfully, but these errors were encountered: