[AAE-7100] ESLint support for ADF Core and DemoShell projects (#7481)

* remove tsconfig.base as per eslint schematics

* add schematics

* upgrade demoshell to eslint

* fix eslint issues for demoshell

* integrate eslint for ADF core and fix some issues

* turn into warn

* fix code

* workaround for Chrome clipboard issue

* exclude e2e tests

* exclude e2e
This commit is contained in:
Denys Vuika
2022-02-02 18:01:47 +00:00
committed by GitHub
parent 6ef4838688
commit b8bb234410
192 changed files with 2553 additions and 483 deletions

View File

@@ -18,17 +18,17 @@
import { Type } from '@angular/core';
import { getType } from './get-type';
export interface DynamicComponentModel { type: string; }
export type DynamicComponentResolveFunction = (model: DynamicComponentModel) => Type<{}>;
export interface DynamicComponentModel { type: string }
export type DynamicComponentResolveFunction = (model: DynamicComponentModel) => Type<any>;
export class DynamicComponentResolver {
static fromType(type: Type<{}>): DynamicComponentResolveFunction {
static fromType(type: Type<any>): DynamicComponentResolveFunction {
return getType(type);
}
}
export abstract class DynamicComponentMapper {
protected defaultValue: Type<{}> = undefined;
protected defaultValue: Type<any> = undefined;
protected types: { [key: string]: DynamicComponentResolveFunction } = {};
/**
@@ -37,7 +37,7 @@ export abstract class DynamicComponentMapper {
* @param defaultValue Default type returned for types that are not yet mapped
* @returns Resolver function
*/
getComponentTypeResolver(type: string, defaultValue: Type<{}> = this.defaultValue): DynamicComponentResolveFunction {
getComponentTypeResolver(type: string, defaultValue: Type<any> = this.defaultValue): DynamicComponentResolveFunction {
if (type) {
return this.types[type] || DynamicComponentResolver.fromType(defaultValue);
}
@@ -84,7 +84,7 @@ export abstract class DynamicComponentMapper {
* @param defaultValue Default type returned for field types that are not yet mapped.
* @returns Component type
*/
resolveComponentType(model: DynamicComponentModel, defaultValue: Type<{}> = this.defaultValue): Type<{}> {
resolveComponentType(model: DynamicComponentModel, defaultValue: Type<any> = this.defaultValue): Type<any> {
if (model) {
const resolver = this.getComponentTypeResolver(model.type, defaultValue);
return resolver(model);