Skip to content

Commit 97703be

Browse files
crisbetojosephperrott
authored andcommitted
chore: add support for noImplicitThis (#13404)
1 parent 5c8e0cb commit 97703be

File tree

21 files changed

+30
-10
lines changed

21 files changed

+30
-10
lines changed

e2e/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"experimentalDecorators": true,
88
"strictNullChecks": true,
99
"strictFunctionTypes": true,
10+
"noImplicitThis": true,
1011
"inlineSources": true,
1112
"lib": ["es2015"],
1213
"module": "commonjs",

e2e/util/asserts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ export function expectLocation(element: FinderResult, {x, y}: Point): void {
3434
*/
3535
export function expectAlignedWith(element: FinderResult, otherElement: FinderResult): void {
3636
getElement(otherElement).getLocation().then((location: Point) => {
37-
this.expectLocation(getElement(element), location);
37+
expectLocation(getElement(element), location);
3838
});
3939
}

src/bazel-tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"strictNullChecks": true,
1414
"strictFunctionTypes": true,
1515
"noImplicitAny": true,
16+
"noImplicitThis": true,
1617
"importHelpers": true,
1718
"newLine": "lf",
1819
"module": "es2015",

src/cdk-experimental/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"strictNullChecks": true,
1010
"strictFunctionTypes": true,
1111
"noImplicitAny": true,
12+
"noImplicitThis": true,
1213
"importHelpers": true,
1314
"newLine": "lf",
1415
"module": "es2015",

src/cdk/a11y/interactivity-checker/interactivity-checker.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ describe('InteractivityChecker', () => {
509509
}
510510
}
511511

512-
function runIf(condition: boolean, runFn: Function): () => void {
512+
function runIf(this: any, condition: boolean, runFn: Function): () => void {
513513
return (...args: any[]) => {
514514
if (condition) {
515515
runFn.apply(this, args);

src/cdk/a11y/key-manager/list-key-manager.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class FakeQueryList<T> extends QueryList<T> {
3737
notifyOnChanges() { this.changes.next(this); }
3838
}
3939

40+
interface KeyEventTestContext {
41+
nextKeyEvent: KeyboardEvent;
42+
prevKeyEvent: KeyboardEvent;
43+
}
4044

4145
describe('Key managers', () => {
4246
let itemList: FakeQueryList<any>;
@@ -164,7 +168,7 @@ describe('Key managers', () => {
164168
expect(fakeKeyEvents.downArrow.defaultPrevented).toBe(false);
165169
});
166170

167-
describe('with `vertical` direction', () => {
171+
describe('with `vertical` direction', function(this: KeyEventTestContext) {
168172
beforeEach(() => {
169173
keyManager.withVerticalOrientation();
170174
this.nextKeyEvent = createKeyboardEvent('keydown', DOWN_ARROW);
@@ -174,7 +178,7 @@ describe('Key managers', () => {
174178
runDirectionalKeyTests.call(this);
175179
});
176180

177-
describe('with `ltr` direction', () => {
181+
describe('with `ltr` direction', function(this: KeyEventTestContext) {
178182
beforeEach(() => {
179183
keyManager.withHorizontalOrientation('ltr');
180184
this.nextKeyEvent = createKeyboardEvent('keydown', RIGHT_ARROW);
@@ -184,7 +188,7 @@ describe('Key managers', () => {
184188
runDirectionalKeyTests.call(this);
185189
});
186190

187-
describe('with `rtl` direction', () => {
191+
describe('with `rtl` direction', function(this: KeyEventTestContext) {
188192
beforeEach(() => {
189193
keyManager.withHorizontalOrientation('rtl');
190194
this.nextKeyEvent = createKeyboardEvent('keydown', LEFT_ARROW);
@@ -199,7 +203,7 @@ describe('Key managers', () => {
199203
* parameters have to be passed in via Jasmine's context object (`this` inside a `beforeEach`)
200204
* because this function has to run before any `beforeEach`, `beforeAll` etc. hooks.
201205
*/
202-
function runDirectionalKeyTests() {
206+
function runDirectionalKeyTests(this: KeyEventTestContext) {
203207
it('should set subsequent items as active when the next key is pressed', () => {
204208
keyManager.onKeydown(this.nextKeyEvent);
205209

src/demo-app/tsconfig-aot.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"strictNullChecks": true,
1111
"strictFunctionTypes": true,
1212
"noImplicitAny": true,
13+
"noImplicitThis": true,
1314
"outDir": "../../dist/packages/demo-app",
1415
"rootDirs": [
1516
".",

src/demo-app/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noUnusedParameters": true,
1111
"strictNullChecks": true,
1212
"strictFunctionTypes": true,
13+
"noImplicitThis": true,
1314
"lib": ["es6", "es2015", "dom"],
1415
"skipLibCheck": true,
1516
"module": "commonjs",

src/e2e-app/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// strict-null compliant.
1111
"strictNullChecks": false,
1212
"strictFunctionTypes": true,
13+
"noImplicitThis": true,
1314
"lib": ["es6", "es2015", "dom"],
1415
"module": "commonjs",
1516
"moduleResolution": "node",

src/lib/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"strictNullChecks": true,
99
"strictFunctionTypes": true,
1010
"noImplicitAny": true,
11+
"noImplicitThis": true,
1112
"importHelpers": true,
1213
"newLine": "lf",
1314
"module": "es2015",

0 commit comments

Comments
 (0)