[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

@@ -23,7 +23,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Directive()
// tslint:disable-next-line: directive-class-suffix
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy {
@Input()

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { Component, Input, SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
@@ -109,12 +109,12 @@ describe('CardViewItemDispatcherComponent', () => {
});
it('should update the subcomponent\'s input parameters', () => {
const expectedEditable = false,
expectedDisplayEmpty = true,
expectedProperty = <CardViewItem> {},
expectedCustomInput = 1,
expectedDisplayNoneOption = false,
expectedDisplayClearAction = false;
const expectedEditable = false;
const expectedDisplayEmpty = true;
const expectedProperty = <CardViewItem> {};
const expectedCustomInput = 1;
const expectedDisplayNoneOption = false;
const expectedDisplayClearAction = false;
component.ngOnChanges({
editable: new SimpleChange(true, expectedEditable, false),

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, Input, OnChanges, OnDestroy } from '@angular/core';
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model';
import { CardViewUpdateService } from '../../services/card-view-update.service';
import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
@@ -30,7 +30,7 @@ import { takeUntil, map } from 'rxjs/operators';
templateUrl: './card-view-selectitem.component.html',
styleUrls: ['./card-view-selectitem.component.scss']
})
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnChanges, OnDestroy {
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnInit, OnChanges, OnDestroy {
static HIDE_FILTER_LIMIT = 5;
@Input() editable: boolean = false;

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ViewEncapsulation, ViewChild, ElementRef, OnDestroy, Inject, Output, EventEmitter } from '@angular/core';
import { Component, ViewEncapsulation, ViewChild, ElementRef, OnDestroy, Inject, Output, EventEmitter, OnInit } from '@angular/core';
import { ESCAPE, TAB } from '@angular/cdk/keycodes';
import { MatSelect } from '@angular/material/select';
import { Subject } from 'rxjs';
@@ -28,7 +28,7 @@ import { takeUntil } from 'rxjs/operators';
host: { 'class': 'adf-select-filter-input' },
encapsulation: ViewEncapsulation.None
})
export class SelectFilterInputComponent implements OnDestroy {
export class SelectFilterInputComponent implements OnInit, OnDestroy {
@ViewChild('selectFilterInput', { read: ElementRef, static: false }) selectFilterInput: ElementRef;
@Output() change = new EventEmitter<string>();

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ChangeDetectorRef, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
import { CardViewUpdateService } from '../../services/card-view-update.service';
import { BaseCardView } from '../base-card-view';
@@ -42,7 +42,7 @@ const templateTypes = {
styleUrls: ['./card-view-textitem.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemModel> implements OnChanges {
export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemModel> implements OnChanges, OnDestroy {
@Input()
editable: boolean = false;
@@ -92,7 +92,11 @@ export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemMode
this.setTemplateType();
if (changes.editable) {
this.isEditable ? this.textInput.enable() : this.textInput.disable();
if (this.isEditable) {
this.textInput.enable();
} else {
this.textInput.disable();
}
}
}