Skip to content

Commit

Permalink
chore: bump eslint to 9.18.0 (#8994)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laffery authored Jan 23, 2025
1 parent bd109e7 commit d70a768
Show file tree
Hide file tree
Showing 255 changed files with 2,568 additions and 1,265 deletions.
37 changes: 0 additions & 37 deletions .eslintignore

This file was deleted.

160 changes: 0 additions & 160 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@
},
"@schematics/angular:directive": {
"prefix": "app"
},
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
},
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
},
"cli": {
Expand Down
9 changes: 7 additions & 2 deletions components/affix/affix.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule, Dir, Direction, Directionality } from '@angular/cdk/bidi';
import { Platform } from '@angular/cdk/platform';
import { DOCUMENT } from '@angular/common';
Expand Down Expand Up @@ -367,8 +372,8 @@ describe('affix', () => {
});

class NzAffixPageObject {
offsets: { [key: string]: Offset };
scrolls: { [key: string]: Scroll };
offsets: Record<string, Offset>;
scrolls: Record<string, Scroll>;

constructor() {
spyOn(component, 'getOffset').and.callFake(this.getOffset.bind(this));
Expand Down
5 changes: 5 additions & 0 deletions components/alert/alert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule, Dir, Direction } from '@angular/cdk/bidi';
import { ChangeDetectorRef, Component, DebugElement, TemplateRef, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
Expand Down
5 changes: 5 additions & 0 deletions components/anchor/anchor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { Platform } from '@angular/cdk/platform';
import { DOCUMENT } from '@angular/common';
import { Component, DebugElement, ElementRef, ViewChild } from '@angular/core';
Expand Down
2 changes: 1 addition & 1 deletion components/auto-complete/autocomplete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function normalizeDataSource(value: AutocompleteDataSource): AutocompleteDataSou
export class NzAutocompleteComponent implements AfterContentInit, AfterViewInit, OnDestroy, OnInit, OnChanges {
@Input({ transform: numberAttributeWithZeroFallback }) nzWidth?: number;
@Input() nzOverlayClassName = '';
@Input() nzOverlayStyle: { [key: string]: string } = {};
@Input() nzOverlayStyle: Record<string, string> = {};
@Input({ transform: booleanAttribute }) nzDefaultActiveFirstOption = true;
@Input({ transform: booleanAttribute }) nzBackfill = false;
@Input() compareWith: CompareWith = (o1, o2) => o1 === o2;
Expand Down
5 changes: 5 additions & 0 deletions components/auto-complete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { Directionality } from '@angular/cdk/bidi';
import { DOWN_ARROW, ENTER, ESCAPE, TAB, UP_ARROW } from '@angular/cdk/keycodes';
import { OverlayContainer } from '@angular/cdk/overlay';
Expand Down
5 changes: 5 additions & 0 deletions components/avatar/avatar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { Component, DebugElement, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
Expand Down
4 changes: 2 additions & 2 deletions components/back-top/back-top.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class NzBackTopComponent implements OnInit, OnDestroy, OnChanges {
@Input({ transform: numberAttribute }) @WithConfig() nzVisibilityHeight: number = 400;
@Input() nzTarget?: string | HTMLElement;
@Input({ transform: numberAttribute }) nzDuration: number = 450;
@Output() readonly nzClick: EventEmitter<boolean> = new EventEmitter();
@Output() readonly nzClick = new EventEmitter<boolean>();

@ViewChild('backTop', { static: false })
set backTop(backTop: ElementRef<HTMLElement> | undefined) {
Expand Down Expand Up @@ -137,7 +137,7 @@ export class NzBackTopComponent implements OnInit, OnDestroy, OnChanges {
}
this.scrollListenerDestroy$.next(true);
this.handleScroll();
fromEventOutsideAngular(this.getTarget(), 'scroll', <AddEventListenerOptions>passiveEventListenerOptions)
fromEventOutsideAngular(this.getTarget(), 'scroll', passiveEventListenerOptions as AddEventListenerOptions)
.pipe(debounceTime(50), takeUntil(this.scrollListenerDestroy$))
.subscribe(() => this.handleScroll());
}
Expand Down
17 changes: 10 additions & 7 deletions components/back-top/back-top.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { Directionality } from '@angular/cdk/bidi';
import { Platform } from '@angular/cdk/platform';
import { ApplicationRef, Component, DebugElement, SimpleChanges, ViewChild } from '@angular/core';
Expand Down Expand Up @@ -205,13 +210,12 @@ describe('nz-back-top', () => {

describe('#nzTemplate', () => {
it(`should show custom template`, fakeAsync(() => {
let fixtureTemplate: ComponentFixture<TestBackTopTemplateComponent>;
fixtureTemplate = TestBed.createComponent(TestBackTopTemplateComponent);
const fixture = TestBed.createComponent(TestBackTopTemplateComponent);

componentObject.scrollTo(window, defaultVisibilityHeight + 1);
tick();
fixtureTemplate.detectChanges();
expect(fixtureTemplate.debugElement.query(By.css('.this-is-my-template')) === null).toBe(false);
fixture.detectChanges();
expect(fixture.debugElement.query(By.css('.this-is-my-template')) === null).toBe(false);
}));
});
});
Expand Down Expand Up @@ -311,10 +315,9 @@ describe('back-to-top', () => {
it('should set correct value for target', fakeAsync(() => {
spyOn<NzSafeAny>(component, 'registerScrollEvent');
spyOn(document, 'querySelector').and.returnValue({} as HTMLElement);
let mockTarget: NzSafeAny = 'mockTarget';
const mockTarget: NzSafeAny = 'mockTarget';
component.nzTarget = mockTarget;
let change: SimpleChanges;
change = {
const change: SimpleChanges = {
nzTarget: {
currentValue: mockTarget,
previousValue: undefined,
Expand Down
2 changes: 1 addition & 1 deletion components/badge/badge-sup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { NzSafeAny, NzSizeDSType } from 'ng-zorro-antd/core/types';
export class NzBadgeSupComponent implements OnInit, OnChanges {
@Input() nzOffset?: [number, number];
@Input() nzTitle?: string | null | undefined;
@Input() nzStyle: { [key: string]: string } | null = null;
@Input() nzStyle: Record<string, string> | null = null;
@Input() nzDot = false;
@Input({ transform: numberAttribute }) nzOverflowCount: number = 99;
@Input() disableAnimation = false;
Expand Down
2 changes: 1 addition & 1 deletion components/badge/badge.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class NzBadgeComponent implements OnChanges, OnDestroy, OnInit {
@Input({ transform: booleanAttribute }) nzDot = false;
@Input() @WithConfig() nzOverflowCount: number = 99;
@Input() @WithConfig() nzColor?: string = undefined;
@Input() nzStyle: { [key: string]: string } | null = null;
@Input() nzStyle: Record<string, string> | null = null;
@Input() nzText?: string | TemplateRef<void> | null = null;
@Input() nzTitle?: string | null | undefined;
@Input() nzStatus?: NzBadgeStatusType | string;
Expand Down
9 changes: 7 additions & 2 deletions components/badge/badge.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule, Dir, Direction } from '@angular/cdk/bidi';
import { Component, DebugElement, SimpleChange, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
Expand Down Expand Up @@ -166,8 +171,8 @@ describe('nz-badge', () => {

it('should set presetColor of nzColor change', fakeAsync(() => {
let color: string | undefined;
let fixture = TestBed.createComponent(NzBadgeComponent);
let component = fixture.componentInstance;
const fixture = TestBed.createComponent(NzBadgeComponent);
const component = fixture.componentInstance;
fixture.detectChanges();

color = badgePresetColors[0];
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/breadcrumb.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class NzBreadCrumbComponent implements OnInit, OnDestroy, NzBreadcrumb {
this.breadcrumbs = this.getBreadcrumbs(activatedRoute.root);
this.cdr.markForCheck();
});
} catch (e) {
} catch {
throw new Error(`${PREFIX} You should import RouterModule if you want to use 'NzAutoGenerate'.`);
}
}
Expand Down
5 changes: 5 additions & 0 deletions components/breadcrumb/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule, Dir, Direction } from '@angular/cdk/bidi';
import { Component, DebugElement, NgZone, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, flush, TestBed, waitForAsync } from '@angular/core/testing';
Expand Down
5 changes: 5 additions & 0 deletions components/button/button-group.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule, Dir, Direction } from '@angular/cdk/bidi';
import { Component, Input, ViewChild } from '@angular/core';
import { fakeAsync, TestBed } from '@angular/core/testing';
Expand Down
Loading

0 comments on commit d70a768

Please sign in to comment.