Skip to content

Commit 96c9014

Browse files
chore: resolve all eslint errors
1 parent 3c873ef commit 96c9014

11 files changed

Lines changed: 19 additions & 16 deletions

File tree

src/directives/uiSref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class UISref implements OnChanges {
168168
this.update();
169169
}
170170

171-
ngOnChanges(changes: SimpleChanges): void {
171+
ngOnChanges(_changes: SimpleChanges): void {
172172
this.update();
173173
}
174174

src/directives/uiSrefStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from '@uirouter/core';
1818

1919
import { Subscription, Observable, BehaviorSubject, of, from, combineLatest, concat } from 'rxjs';
20-
import { switchMap, map, tap } from 'rxjs/operators';
20+
import { switchMap, map } from 'rxjs/operators';
2121

2222
/** @internal */
2323
interface TransEvt {
@@ -66,7 +66,7 @@ const pathMatches = (target: TargetState): Predicate<PathNode[]> => {
6666
const paramSchema: Param[] = targetPath
6767
.map((node) => node.paramSchema)
6868
.reduce(unnestR, [])
69-
.filter((param: Param) => targetParamVals.hasOwnProperty(param.id));
69+
.filter((param: Param) => Object.prototype.hasOwnProperty.call(targetParamVals, param.id));
7070

7171
return (path: PathNode[]) => {
7272
const tailNode = tail(path);

src/directives/uiView.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ export class UIView implements OnInit, OnDestroy {
135135
/** The reference to the component currently inside the viewport */
136136
readonly _componentRef = signal<ComponentRef<any> | null>(null);
137137
/** Deregisters the ui-view from the view service */
138-
private _deregisterUIView: Function;
139-
/** Deregisters the master uiCanExit transition hook */
138+
private _deregisterUIView: () => void;
139+
/** Deregisters the master uiCanExit transition hook (returns Function from @uirouter/core) */
140+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
140141
private _deregisterUiCanExitHook: Function;
141-
/** Deregisters the master uiOnParamsChanged transition hook */
142+
/** Deregisters the master uiOnParamsChanged transition hook (returns Function from @uirouter/core) */
143+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
142144
private _deregisterUiOnParamsChangedHook: Function;
143145
/** Data about the this UIView */
144146
private _uiViewData: ActiveUIView = <any>{};

src/lazyLoad/lazyLoadNgModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export function applyComponent<T>(
244244
const current = stateObject.component;
245245
stateObject.component = component || current;
246246
const removed = registry.deregister(stateObject).map((child) => child.self);
247-
const children = removed.filter((i) => i.name != stateObject.name);
247+
const children = removed.filter((i) => i.name !== stateObject.name);
248248

249249
return { states: [stateObject, ...children] };
250250
}

src/location/locationConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Ng2LocationConfig extends BrowserLocationConfig {
99
super(router, is(PathLocationStrategy)(_locationStrategy));
1010
}
1111

12-
baseHref(href?: string): string {
12+
baseHref(_href?: string): string {
1313
return this._locationStrategy.getBaseHref();
1414
}
1515
}

src/statebuilders/lazyLoad.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { LazyLoadResult, Transition, StateDeclaration } from '@uirouter/core'; // has or is using
21
import { BuilderFunction, StateObject } from '@uirouter/core';
32
import { loadComponent, loadNgModule } from '../lazyLoad/lazyLoadNgModule';
43

@@ -45,7 +44,7 @@ import { loadComponent, loadNgModule } from '../lazyLoad/lazyLoadNgModule';
4544
* ```
4645
*
4746
*/
48-
export function ng2LazyLoadBuilder(state: StateObject, parent: BuilderFunction) {
47+
export function ng2LazyLoadBuilder(state: StateObject, _parent: BuilderFunction) {
4948
const loadComponentFn = state['loadComponent'];
5049
const loadNgModuleFn = state['loadChildren'];
5150
return loadComponentFn

src/uiRouterConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function applyModuleConfig(uiRouter: UIRouter, injector: Injector, module
1313
}
1414

1515
export function applyRootModuleConfig(uiRouter: UIRouter, injector: Injector, module: RootModule) {
16-
isDefined(module.deferIntercept) && uiRouter.urlService.deferIntercept(module.deferIntercept);
17-
isDefined(module.otherwise) && uiRouter.urlService.rules.otherwise(module.otherwise);
18-
isDefined(module.initial) && uiRouter.urlService.rules.initial(module.initial);
16+
if (isDefined(module.deferIntercept)) uiRouter.urlService.deferIntercept(module.deferIntercept);
17+
if (isDefined(module.otherwise)) uiRouter.urlService.rules.otherwise(module.otherwise);
18+
if (isDefined(module.initial)) uiRouter.urlService.rules.initial(module.initial);
1919
}

test/uiSrefActive/uiSrefActive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('uiSrefActive', () => {
5959
await router.stateService.go('statea');
6060
await tick();
6161
fixture.detectChanges();
62-
let classList = des[0].nativeElement.classList;
62+
const classList = des[0].nativeElement.classList;
6363
expect(classList).toContain(activeClasses[0]);
6464
expect(classList).toContain(activeClasses[1]);
6565
});

test/uiSrefStatus/uiSrefStatus.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('uiSrefStatus', () => {
1414
standalone: false,
1515
})
1616
class TestComponent {
17-
updated(event: SrefStatus) {
17+
updated(_event: SrefStatus) {
1818
throw new Error('updated() method must be spied');
1919
}
2020
}

test/uiView/resolveBinding.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ describe('uiView', () => {
99
describe('should map resolve data to inputs', () => {
1010
@Component({ template: `<h3>hey</h3> `, standalone: false })
1111
class ManyResolvesComponent {
12+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1213
constructor(@Inject('resolve1') foo, @Inject('Resolve2') bar, @Inject('resolve5') baz) {
14+
// eslint-disable-next-line prefer-rest-params
1315
this.injectedValues = Array.from(arguments);
1416
}
1517

0 commit comments

Comments
 (0)