diff --git a/types/angular/test/jquery3-merging-tests.ts b/types/angular/test/jquery3-merging-tests.ts index 510519466b..507c58b67e 100644 --- a/types/angular/test/jquery3-merging-tests.ts +++ b/types/angular/test/jquery3-merging-tests.ts @@ -1,9 +1,11 @@ import $ = require('jquery'); import * as angular from 'angular'; +// Fix TODOs once https://github.com/Microsoft/TypeScript/issues/18910 is fixed + function JQuery() { function indexSignature() { - $('p')[0]; // $ExpectType HTMLElement + $('p')[0]; // TODO: $ExpectType HTMLElement } function addClass() { @@ -12,7 +14,7 @@ function JQuery() { // $ExpectType JQuery $('p').addClass(function(index, currentClassName) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -35,7 +37,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('alt', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -47,7 +49,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('width', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -59,7 +61,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('title', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -69,7 +71,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('title', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -96,9 +98,9 @@ function JQuery() { // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -106,15 +108,15 @@ function JQuery() { $('p').bind('myEvent', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('p').bind('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -122,7 +124,7 @@ function JQuery() { $('p').bind('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -133,15 +135,15 @@ function JQuery() { $('p').bind({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -162,13 +164,13 @@ function JQuery() { } function off() { - function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event) { } + function defaultContext_defaultData(this: HTMLElement, event: JQueryEventObject) { } - function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } + function defaultContext_customData(this: HTMLElement, event: JQueryEventObject) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: I1, event: JQueryEventObject) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: I1, event: JQueryEventObject) { } interface I1 { kind: 'I1'; } @@ -238,9 +240,9 @@ function JQuery() { // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -248,15 +250,15 @@ function JQuery() { $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', null, 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -264,15 +266,15 @@ function JQuery() { $('table').on('myEvent', null, 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -280,7 +282,7 @@ function JQuery() { $('table').on('myEvent', 'td', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -289,9 +291,9 @@ function JQuery() { // $ExpectType JQuery $('table').on('myEvent', 3, function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -299,15 +301,15 @@ function JQuery() { $('table').on('myEvent', 3, function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -315,7 +317,7 @@ function JQuery() { $('table').on('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -326,15 +328,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td', 'myData'); @@ -343,15 +345,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, null, 'myData'); @@ -360,15 +362,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td'); @@ -377,15 +379,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 3); @@ -394,15 +396,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -413,9 +415,9 @@ function JQuery() { // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -423,15 +425,15 @@ function JQuery() { $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', null, 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -439,15 +441,15 @@ function JQuery() { $('table').one('myEvent', null, 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -455,7 +457,7 @@ function JQuery() { $('table').one('myEvent', 'td', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -464,9 +466,9 @@ function JQuery() { // $ExpectType JQuery $('table').one('myEvent', 3, function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -474,15 +476,15 @@ function JQuery() { $('table').one('myEvent', 3, function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -490,7 +492,7 @@ function JQuery() { $('table').one('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -501,15 +503,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td', 'myData'); @@ -518,15 +520,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, null, 'myData'); @@ -535,15 +537,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td'); @@ -552,15 +554,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 3); @@ -569,15 +571,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -589,7 +591,7 @@ function JQuery() { // $ExpectType JQuery $('p').removeClass(function(index, currentClassName) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -609,7 +611,7 @@ function JQuery() { // $ExpectType JQuery $('p').toggleClass(function(index, className, state) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -626,7 +628,7 @@ function JQuery() { // $ExpectType JQuery $('p').toggleClass(function(index, className, state) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; diff --git a/types/angular/tslint.json b/types/angular/tslint.json index 77b236700e..b0c1e9007a 100644 --- a/types/angular/tslint.json +++ b/types/angular/tslint.json @@ -14,6 +14,7 @@ "max-line-length": false, "no-empty-interface": false, "no-namespace": false, + "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, "no-void-expression": false, "unified-signatures": false,