Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rfrt committed Aug 5, 2024
1 parent c64d8bb commit 6c397b0
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"root": true,
"extends": ["@hug/eslint-config/recommended"],
"rules": {
// Use dwdwdw and ngOnDestroy
// Use destroyRef and takeUntilDestroyed
"rxjs-angular/prefer-takeuntil": "off"
}
}
1 change: 0 additions & 1 deletion projects/core/src/directives/input-autosize.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DestroyRef, Directive, ElementRef, inject, NgZone, OnInit } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

import { MatInput } from '@angular/material/input';
import { debounceTime, fromEvent, mergeWith, of, startWith } from 'rxjs';

Expand Down
3 changes: 1 addition & 2 deletions projects/core/src/directives/single-click.directive.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { DestroyRef, Directive, EventEmitter, HostListener, inject, Input, OnInit, Output } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ReplaySubject } from 'rxjs';
import { throttleTime } from 'rxjs/operators';

import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

@Directive({
selector: '[ngx-single-click]',
standalone: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { DestroyRef, Directive, ElementRef, forwardRef, inject, Input, OnInit, Renderer2 } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { AbstractControl, NG_VALIDATORS, NgControl } from '@angular/forms';
import { DateAdapter, MAT_DATE_FORMATS, MatDateFormats } from '@angular/material/core';
import { filterMap, KeyCodes, subscribeWith } from '@hug/ngx-core';
Expand All @@ -8,7 +9,6 @@ import { isNil } from 'lodash-es';
import { delay, EMPTY, filter, fromEvent, mergeWith, of, startWith, switchMap, tap, timeInterval } from 'rxjs';

import { NgxDatepickerMaskValidatorService } from './datepicker-mask-validator.service';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';


@Directive({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { TemplatePortal } from '@angular/cdk/portal';
import { AfterViewInit, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, OnDestroy, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatButtonModule } from '@angular/material/button';
import { DateAdapter } from '@angular/material/core';
import { MatDatepicker, MatDatepickerInput, MatDatepickerModule, MatDateSelectionModel } from '@angular/material/datepicker';
Expand All @@ -8,7 +9,6 @@ import { cloneDeep } from 'lodash-es';
import { delay, filter, map, tap } from 'rxjs';

import { DATE_TIME_ADAPTER, DateTimeAdapter } from '../date-adapter/date-time-adapter';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';


@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { AsyncPipe, DatePipe, NgIf, registerLocaleData } from '@angular/common';
import localeFrCh from '@angular/common/locales/fr-CH';
import { ChangeDetectionStrategy, Component, DestroyRef, inject, Injectable, LOCALE_ID, ViewEncapsulation } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormControl, FormGroup, ReactiveFormsModule, ValidationErrors } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
Expand All @@ -24,7 +25,6 @@ import { NgxDatepickerButtonsComponent, NgxDatepickerMaskDirective, NgxDatepicke
import { addDays, addMonths, endOfMonth, startOfDay, startOfMonth } from 'date-fns';
import { frCH } from 'date-fns/locale';
import { debounceTime, ReplaySubject } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

registerLocaleData(localeFrCh);
setLocale(frCH);
Expand Down Expand Up @@ -130,7 +130,7 @@ export class DatePickerDemoComponent {
public maxDate: Date;
public defaultValues: DateRange<Date>;

private destroyRef = inject(DestroyRef)
private destroyRef = inject(DestroyRef);

public constructor() {

Expand Down
1 change: 1 addition & 0 deletions projects/snackbar/src/snackbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class NgxSnackbarComponent implements OnInit, AfterViewInit, OnDestroy {
this._alignments.bottom = this._alignments.top && this._alignments.bottom ? false : this._alignments.bottom;
this._alignments.left = this._alignments.right && this._alignments.left ? false : this._alignments.left;
}

private destroyRef = inject(DestroyRef);

/**
Expand Down
2 changes: 1 addition & 1 deletion projects/splitter/src/splitter.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BooleanInput, coerceBooleanProperty, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion';
import { NgFor, NgForOf, NgIf } from '@angular/common';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, DestroyRef, ElementRef, EventEmitter, HostBinding, inject, Input, Output, QueryList, ViewEncapsulation } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { filter, fromEvent, map, mergeWith, of, shareReplay, Subject, switchMap, take, takeUntil, tap } from 'rxjs';

import { NgxSplitAreaDirective } from './split-area.directive';
import { NgxSplitterDirection } from './splitter-direction-type';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

interface DraggingEvent {
event: MouseEvent | TouchEvent;
Expand Down
2 changes: 1 addition & 1 deletion projects/status/src/status.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, inject, Input, ViewEncapsulation } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { catchError, EMPTY, Subject, switchMap, throttleTime } from 'rxjs';

import { NgxStatus, NgxStatusAction, NgxStatusType } from './status.model';
import { NgxStatusDetailDialogService } from './status-detail/status-detail-dialog.service';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

@Component({
selector: 'ngx-status',
Expand Down
2 changes: 1 addition & 1 deletion projects/status/src/status.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DOCUMENT } from '@angular/common';
import { ApplicationRef, ComponentFactoryResolver, DestroyRef, EmbeddedViewRef, inject, Injectable, Injector } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { NgxLazyLoaderService } from '@hug/ngx-core';
import { mergeWith, switchMap, take, tap, timer } from 'rxjs';

import { NgxStatus, NgxStatusAction } from './status.model';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';


const durationLong = 30_000;
Expand Down
2 changes: 1 addition & 1 deletion projects/tooltip/src/tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class NgxTooltipDirective {
@Input('ngx-tooltip') public openTooltip$?: (element: HTMLElement) => Observable<void>;

private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
private destroyRef = inject(DestroyRef)
private destroyRef = inject(DestroyRef);

public constructor() {

Expand Down

0 comments on commit 6c397b0

Please sign in to comment.