mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
integrate Prettier with tslint (#1419)
* integrate prettier with tslint * remove obsolte scripts * update tsconfig * fix lint issues * fix lint errors * more rules and fixes * kebab case and lint fixes * update helpers * update util
This commit is contained in:
@@ -28,8 +28,9 @@ import { ContextMenu } from '@alfresco/aca-shared/store';
|
||||
import { fakeAsync, tick } from '@angular/core/testing';
|
||||
|
||||
describe('ContextActionsDirective', () => {
|
||||
let directive;
|
||||
const storeMock = <any>{
|
||||
let directive: ContextActionsDirective;
|
||||
|
||||
const storeMock: any = {
|
||||
dispatch: jasmine.createSpy('dispatch')
|
||||
};
|
||||
|
||||
@@ -52,7 +53,7 @@ describe('ContextActionsDirective', () => {
|
||||
const fragment = document.createDocumentFragment();
|
||||
fragment.appendChild(el);
|
||||
const target = fragment.querySelector('div');
|
||||
const mouseEventMock = <any>{ preventDefault: () => {}, target };
|
||||
const mouseEventMock: any = { preventDefault: () => {}, target };
|
||||
|
||||
directive.ngOnInit();
|
||||
|
||||
|
@@ -88,7 +88,8 @@ export class ContextActionsDirective implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private getTarget(event: MouseEvent): Element {
|
||||
return this.findAncestor(<Element>event.target, 'adf-datatable-cell');
|
||||
const target = event.target as Element;
|
||||
return this.findAncestor(target, 'adf-datatable-cell');
|
||||
}
|
||||
|
||||
private isSelected(target: Element): boolean {
|
||||
|
@@ -38,7 +38,7 @@ describe('AppRouteReuseStrategy', () => {
|
||||
});
|
||||
|
||||
it('should allow detach if route is configured to be reused', () => {
|
||||
const route = <any>{
|
||||
const route: any = {
|
||||
routeConfig: {
|
||||
data: {
|
||||
reuse: true
|
||||
@@ -46,11 +46,11 @@ describe('AppRouteReuseStrategy', () => {
|
||||
path: 'tested-path'
|
||||
}
|
||||
};
|
||||
expect(appRouteReuse.shouldDetach(<any>route)).toBe(true);
|
||||
expect(appRouteReuse.shouldDetach(route)).toBe(true);
|
||||
});
|
||||
|
||||
it('should store on routeCache', () => {
|
||||
const route = <any>{
|
||||
const route: any = {
|
||||
url: [],
|
||||
routeConfig: {
|
||||
data: {
|
||||
@@ -63,11 +63,11 @@ describe('AppRouteReuseStrategy', () => {
|
||||
children: []
|
||||
};
|
||||
appRouteReuse.store(route, { route: {} });
|
||||
expect(appRouteReuse.shouldAttach(<any>route)).toBe(true);
|
||||
expect(appRouteReuse.shouldAttach(route)).toBe(true);
|
||||
});
|
||||
|
||||
it('should clear routeCache on resetCache', () => {
|
||||
const route = <any>{
|
||||
const route: any = {
|
||||
url: [],
|
||||
routeConfig: {
|
||||
data: {
|
||||
@@ -81,6 +81,6 @@ describe('AppRouteReuseStrategy', () => {
|
||||
};
|
||||
appRouteReuse.store(route, { route: {} });
|
||||
appRouteReuse.resetCache();
|
||||
expect(appRouteReuse.shouldAttach(<any>route)).toBe(false);
|
||||
expect(appRouteReuse.shouldAttach(route)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
@@ -91,6 +91,6 @@ describe('AppService', () => {
|
||||
isReady = value;
|
||||
});
|
||||
auth.onLogin.next();
|
||||
await expect(<any>isReady).toEqual(true);
|
||||
await expect(isReady).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
@@ -259,7 +259,7 @@ export class ContentApiService {
|
||||
|
||||
addFavorite(nodes: Array<MinimalNodeEntity>): Observable<FavoriteEntry> {
|
||||
const payload: FavoriteBody[] = nodes.map(node => {
|
||||
const { isFolder, nodeId, id } = <any>node.entry;
|
||||
const { isFolder, nodeId, id } = node.entry as any;
|
||||
const siteId = node.entry['guid'];
|
||||
const type = siteId ? 'site' : isFolder ? 'folder' : 'file';
|
||||
const guid = siteId || nodeId || id;
|
||||
@@ -273,7 +273,7 @@ export class ContentApiService {
|
||||
};
|
||||
});
|
||||
|
||||
return from(this.api.favoritesApi.addFavorite('-me-', <any>payload));
|
||||
return from(this.api.favoritesApi.addFavorite('-me-', payload as any));
|
||||
}
|
||||
|
||||
removeFavorite(nodes: Array<MinimalNodeEntity>): Observable<any> {
|
||||
|
Reference in New Issue
Block a user