[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

@@ -1090,7 +1090,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'material-icons://android';
}
};
@@ -1102,7 +1102,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'http://www.google.com';
}
};
@@ -1114,7 +1114,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'material-icons://android';
}
};
@@ -1126,7 +1126,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'http://www.google.com';
}
};
@@ -1229,7 +1229,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'id';
}
};

View File

@@ -15,10 +15,12 @@
* limitations under the License.
*/
/* eslint-disable @angular-eslint/no-conflicting-lifecycle */
import {
ViewChildren, QueryList, HostListener,
AfterContentInit, Component, ContentChild, DoCheck, ElementRef, EventEmitter, Input,
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation, OnDestroy
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation, OnDestroy, AfterViewInit
} from '@angular/core';
import { FocusKeyManager } from '@angular/cdk/a11y';
import { MatCheckboxChange } from '@angular/material/checkbox';
@@ -57,7 +59,7 @@ export enum ShowHeaderMode {
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-datatable' }
})
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, OnDestroy {
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, OnDestroy, AfterViewInit {
@ViewChildren(DataTableRowComponent)
rowsList: QueryList<DataTableRowComponent>;
@@ -122,7 +124,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
* docs for more details and usage examples.
*/
@Input()
rowStyle: { [key: string]: any; };
rowStyle: { [key: string]: any };
/** The CSS class to apply to every row. */
@Input()
@@ -203,7 +205,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
private click$: Observable<DataRowEvent>;
private differ: any;
private rowMenuCache: object = {};
private rowMenuCache: any = {};
private subscriptions: Subscription[] = [];
private singleClickStreamSub: Subscription;
@@ -856,7 +858,7 @@ export interface DataTableDropEvent {
target: 'cell' | 'header';
event: Event;
column: DataColumn;
row?: DataRow
row?: DataRow;
};
preventDefault(): void;

View File

@@ -57,7 +57,7 @@ export class JsonCellComponent extends DataTableCellComponent implements OnInit
}
view() {
const rawValue: string | object = this.data.getValue(this.row, this.column, this.resolverFn);
const rawValue: string | any = this.data.getValue(this.row, this.column, this.resolverFn);
const value = typeof rawValue === 'object'
? JSON.stringify(rawValue || {}, null, 2)
: rawValue;