mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: eslint fixes and code improvements
This commit is contained in:
5 files changed
+15
-9
No files matched your search
@@ -41,7 +41,11 @@
|
||||
"ignoredNodes": ["TSTypeParameterInstantiation"]
|
||||
}
|
||||
],
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error"],
|
||||
"@typescript-eslint/no-duplicate-imports": ["error"],
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/no-unsafe-argument": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-unsafe-call": 0,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MockComponent, MockProvider } from 'ng-mocks';
|
||||
import { MockComponent, MockProvider, MockModule, MockPipe } from 'ng-mocks';
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
@@ -6,7 +6,6 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { EpgListComponent, EpgData } from './epg-list.component';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MockModule, MockPipe } from 'ng-mocks';
|
||||
import { ElectronService } from '../../../services/electron.service';
|
||||
import { ElectronServiceStub } from '../../../home/home.component.spec';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -10,6 +10,9 @@ import {
|
||||
import { Channel } from '../../../state';
|
||||
import Hls from 'hls.js';
|
||||
|
||||
/**
|
||||
* This component contains the implementation of HTML5 based video player
|
||||
*/
|
||||
@Component({
|
||||
selector: 'app-html-video-player',
|
||||
templateUrl: './html-video-player.component.html',
|
||||
@@ -78,13 +81,13 @@ export class HtmlVideoPlayerComponent implements OnChanges, OnDestroy {
|
||||
|
||||
if (playPromise !== undefined) {
|
||||
playPromise
|
||||
.then((_) => {
|
||||
.then(() => {
|
||||
// Automatic playback started!
|
||||
if (!this.showCaptions) {
|
||||
this.disableCaptions();
|
||||
}
|
||||
})
|
||||
.catch((error) => {});
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ import 'videojs-hls-quality-selector';
|
||||
import 'videojs-contrib-quality-levels';
|
||||
import '@yangkghjh/videojs-aspect-ratio-panel';
|
||||
|
||||
/**
|
||||
* This component contains the implementation of video player that is based on video.js library
|
||||
*/
|
||||
@Component({
|
||||
selector: 'app-vjs-player',
|
||||
templateUrl: './vjs-player.component.html',
|
||||
@@ -21,7 +24,7 @@ import '@yangkghjh/videojs-aspect-ratio-panel';
|
||||
})
|
||||
export class VjsPlayerComponent implements OnInit, OnDestroy {
|
||||
/** DOM-element reference */
|
||||
@ViewChild('target', { static: true }) target: ElementRef;
|
||||
@ViewChild('target', { static: true }) target: ElementRef<Element>;
|
||||
/** Options of VideoJs player */
|
||||
@Input() options: videoJs.PlayerOptions;
|
||||
/** VideoJs object */
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { StorageMap } from '@ngx-pwa/local-storage';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
import { ElectronService } from './../services/electron.service';
|
||||
import { ElectronServiceStub } from './../home/home.component.spec';
|
||||
@@ -18,7 +17,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { MockModule, MockPipe, MockComponent } from 'ng-mocks';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { EPG_FETCH } from '../../../shared/ipc-commands';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -37,7 +36,6 @@ describe('SettingsComponent', () => {
|
||||
let component: SettingsComponent;
|
||||
let fixture: ComponentFixture<SettingsComponent>;
|
||||
let electronService: ElectronService;
|
||||
let storage: StorageMap;
|
||||
let router: Router;
|
||||
|
||||
beforeEach(
|
||||
@@ -82,7 +80,6 @@ describe('SettingsComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SettingsComponent);
|
||||
electronService = TestBed.inject(ElectronService);
|
||||
storage = TestBed.inject(StorageMap);
|
||||
router = TestBed.inject(Router);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
Reference in new issue
Block a user