[AAE-622] No implicit returns (#5157)

* enable noImplicitReturns rule

* type fixes

* fix return types

* fix return value

* fix tests

* fix visibility service

* update tests

* add missing types

* fix test
This commit is contained in:
Denys Vuika
2019-10-17 09:35:39 +01:00
committed by GitHub
parent 48aca2d30f
commit d7ab0417b8
65 changed files with 366 additions and 319 deletions

View File

@@ -386,7 +386,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return node && node.list && node.list.entries.length === 0;
}
onContentActionError(errors) {
onContentActionError(errors: any) {
const errorStatusCode = JSON.parse(errors.message).error.statusCode;
let translatedErrorMessage: any;
@@ -404,24 +404,24 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.openSnackMessage(translatedErrorMessage);
}
onContentActionSuccess(message) {
onContentActionSuccess(message: string) {
const translatedMessage: any = this.translateService.instant(message);
this.openSnackMessage(translatedMessage);
this.documentList.reload();
}
onDeleteActionSuccess(message) {
onDeleteActionSuccess(message: string) {
this.uploadService.fileDeleted.next(message);
this.deleteElementSuccess.emit();
this.documentList.reload();
this.openSnackMessage(message);
}
onPermissionRequested(node) {
onPermissionRequested(node: any) {
this.router.navigate(['/permissions', node.value.entry.id]);
}
onManageVersions(event) {
onManageVersions(event: any) {
const contentEntry = event.value.entry;
const showComments = this.showVersionComments;
const allowDownload = this.allowVersionDownload;
@@ -438,7 +438,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
}
onManageMetadata(event) {
onManageMetadata(event: any) {
const contentEntry = event.value.entry;
if (this.contentService.hasAllowableOperations(contentEntry, 'update')) {
@@ -499,7 +499,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return false;
}
startProcessAction($event) {
startProcessAction($event: any) {
this.formValues['file'] = $event.value.entry;
const dialogRef = this.dialog.open(SelectAppsDialogComponent, {
@@ -588,15 +588,15 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return true;
}
runCustomAction(event) {
runCustomAction(event: any) {
this.logService.log(event);
}
getFileFiltering() {
getFileFiltering(): string {
return this.acceptedFilesTypeShow ? this.acceptedFilesType : '*';
}
createLibrary() {
createLibrary(): void {
const dialogInstance: any = this.dialog.open(LibraryDialogComponent, {
width: '400px'
});
@@ -610,5 +610,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
if (search && search.highlight) {
return search.highlight.map((currentHighlight) => currentHighlight.snippets).join(', ');
}
return '';
}
}

View File

@@ -8,12 +8,12 @@
CLICKED NODE: {{clickedNodeName}}
</span>
<adf-tree-view-list *ngIf="!errorMessage; else erroOccurred"
<adf-tree-view-list *ngIf="!errorMessage; else errorOccurred"
[nodeId]="nodeIdSample"
(nodeClicked)="onClick($event)"
(error)="onErrorOccurred($event)">
</adf-tree-view-list>
<ng-template #erroOccurred>
<ng-template #errorOccurred>
<span>An Error Occurred </span>
<span>{{errorMessage}}</span>
</ng-template>

View File

@@ -25,7 +25,7 @@ import { Component } from '@angular/core';
export class TreeViewSampleComponent {
clickedNodeName: string = '';
errorMessage = '';
errorMessage: string = '';
nodeIdSample: string = '-my-';
@@ -38,7 +38,7 @@ export class TreeViewSampleComponent {
this.errorMessage = '';
}
onErrorOccurred(error) {
onErrorOccurred(error: string) {
this.clickedNodeName = '';
this.errorMessage = error;
}

View File

@@ -12,6 +12,7 @@
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"target": "es5",
"allowSyntheticDefaultImports": true,
"typeRoots": [