Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIH-11136 remove unused vars and imports add unused imports to lint #1446

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion AdminWebsite/AdminWebsite/ClientApp/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ module.exports = {
project: 'tsconfig.json',
sourceType: 'module'
},
plugins: ['eslint-plugin-import', '@angular-eslint/eslint-plugin', '@typescript-eslint', '@typescript-eslint/tslint', 'jasmine'],
plugins: [
'eslint-plugin-import',
'@angular-eslint/eslint-plugin',
'@typescript-eslint',
'@typescript-eslint/tslint',
'jasmine',
'unused-imports'
],
root: true,
rules: {
'unused-imports/no-unused-imports': 'error',
'jasmine/no-focused-tests': 'error',
'@angular-eslint/component-class-suffix': 'error',
'@angular-eslint/directive-class-suffix': 'error',
Expand Down
16 changes: 16 additions & 0 deletions AdminWebsite/AdminWebsite/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions AdminWebsite/AdminWebsite/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jasmine": "^4.1.3",
"eslint-plugin-unused-imports": "^4.1.4",
"jasmine-core": "^5.1.2",
"jasmine-spec-reporter": "~6.0.0",
"karma": "^6.4.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { of } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DatePipe } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { AbstractControl, FormArray, ReactiveFormsModule } from '@angular/forms';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import { ConfirmationPopupStubComponent } from '../../testing/stubs/confirmation
import { BreadcrumbComponent } from '../breadcrumb/breadcrumb.component';
import { OtherInformationComponent } from './other-information.component';
import { ParticipantModel } from '../../common/model/participant.model';
import { of } from 'rxjs';
import { CaseModel } from 'src/app/common/model/case.model';
import { HearingModel } from 'src/app/common/model/hearing.model';
import { LaunchDarklyService, FeatureFlags } from 'src/app/services/launch-darkly.service';
import { LaunchDarklyService } from 'src/app/services/launch-darkly.service';
import { BreadcrumbStubComponent } from 'src/app/testing/stubs/breadcrumb-stub';

function initHearingRequest(): HearingModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { VideoHearingsService } from 'src/app/services/video-hearings.service';
import { Constants } from 'src/app/common/constants';
import { ParticipantModel } from 'src/app/common/model/participant.model';
import { PageUrls } from 'src/app/shared/page-url.constants';
import { of } from 'rxjs';
import { VideoSupplier } from 'src/app/services/clients/api-client';

const router = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Logger } from '../../services/logger';
import { SearchService } from '../../services/search.service';
import { SearchEmailComponent } from './search-email.component';
import { DebugElement, ElementRef } from '@angular/core';
import { FeatureFlags, LaunchDarklyService } from 'src/app/services/launch-darkly.service';
import { LaunchDarklyService } from 'src/app/services/launch-darkly.service';

describe('SearchEmailComponent', () => {
let component: SearchEmailComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpClientModule } from '@angular/common/http';
import { Component, Directive, EventEmitter, Output } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, TestBed, waitForAsync } from '@angular/core/testing';
import { AbstractControl, FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { Router } from '@angular/router';
Expand All @@ -9,7 +9,7 @@ import * as moment from 'moment';
import { MomentModule } from 'ngx-moment';
import { of } from 'rxjs';
import { ConfigService } from 'src/app/services/config.service';
import { FeatureFlags, LaunchDarklyService } from 'src/app/services/launch-darkly.service';
import { LaunchDarklyService } from 'src/app/services/launch-darkly.service';
import { Logger } from 'src/app/services/logger';
import { ReferenceDataService } from 'src/app/services/reference-data.service';
import { ReturnUrlService } from 'src/app/services/return-url.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TestBed } from '@angular/core/testing';
import { ActivatedRouteSnapshot, Router } from '@angular/router';
import { CanDeactiveComponent, ChangesGuard } from './changes.guard';
import { VhoWorkHoursNonAvailabilityTableComponent } from '../../work-allocation/edit-work-hours/vho-work-hours-non-availability-table/vho-work-hours-non-availability-table.component';
import { ActivatedRouteSnapshot } from '@angular/router';
import { ChangesGuard } from './changes.guard';

const activatedRouteSnapshot: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { TestBed } from '@angular/core/testing';
import { JudgeAccountType, JudgeResponse, PersonResponse } from 'src/app/services/clients/api-client';
import { ParticipantModel } from './participant.model';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Logger } from 'src/app/services/logger';

import { ConfirmDeletePopupComponent } from './confirm-delete-popup.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fakeAsync, flushMicrotasks, tick, waitForAsync } from '@angular/core/testing';
import { fakeAsync, flushMicrotasks } from '@angular/core/testing';
import { FormBuilder } from '@angular/forms';
import { of } from 'rxjs';
import { HearingsByUsernameForDeletionResponse } from 'src/app/services/clients/api-client';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fakeAsync, flush } from '@angular/core/testing';
import { FormBuilder } from '@angular/forms';
import { CvpAudioSearchModel } from 'src/app/common/model/cvp-audio-search-model';
import { AudioLinkService, ICvpAudioRecordingResult } from 'src/app/services/audio-link-service';
import { CvpForAudioFileResponse } from 'src/app/services/clients/api-client';
import { Logger } from 'src/app/services/logger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FormBuilder } from '@angular/forms';
import { AudioLinkService } from '../services/audio-link-service';
import { Logger } from '../services/logger';
import { GetAudioFileComponent } from './get-audio-file.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { fakeAsync } from '@angular/core/testing';
import { OidcSecurityService } from 'angular-auth-oidc-client';
import { Observable, of, Subject } from 'rxjs';
import { UserIdentityService } from '../services/user-identity.service';
import { LogoutComponent } from './logout.component';
import { MockAuthenticatedResult, MockSecurityService } from '../testing/mocks/MockOidcSecurityService';
import { IdpProviders, SecurityService } from './services/security.service';
import { MockSecurityService } from '../testing/mocks/MockOidcSecurityService';
import { IdpProviders } from './services/security.service';

describe('LogoutComponent', () => {
let component: LogoutComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReformLoginComponent } from './reform-login.component';
import { IdpProviders, SecurityService } from './services/security.service';
import { Router } from '@angular/router';
import { ConfigService } from '../services/config.service';

describe('LoginReformComponent', () => {
let component: ReformLoginComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestBed } from '@angular/core/testing';
import { SecurityService, IdpProviders } from './security.service';
import { OidcSecurityService, OpenIdConfiguration, LoginResponse } from 'angular-auth-oidc-client';
import { OidcSecurityService, OpenIdConfiguration } from 'angular-auth-oidc-client';
import { of } from 'rxjs';

describe('SecurityService', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fakeAsync, flush, flushMicrotasks, tick } from '@angular/core/testing';
import { fakeAsync, flush } from '@angular/core/testing';
import { Observable, of, throwError } from 'rxjs';
import { MockLogger } from '../shared/testing/mock-logger';
import { AudioLinkService, InvalidParametersError } from './audio-link-service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';
import { LinkedParticipantModel } from '../common/model/linked-participant.model';
import { BookingDetailsService } from './booking-details.service';
import {
HearingDetailsResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { DebugElement } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { BookingsHearingResponse } from 'src/app/services/clients/api-client';
import { VideoHearingsService } from 'src/app/services/video-hearings.service';
import { BookingService } from '../../services/booking.service';
import { BookingEditComponent } from './booking-edit.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { VhoWorkHoursResponse } from '../../services/clients/api-client';
import { VhoWorkHoursTableComponent } from '../../work-allocation/edit-work-hours/vho-work-hours-table/vho-work-hours-table.component';
export class MockWorkAllocationValuesWorkHours {
static VhoWorkHoursResponse(): VhoWorkHoursResponse[] {
const jsonObj: [] = JSON.parse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CanDeactiveComponent } from 'src/app/common/guards/changes.guard';
export class MockChangesGuard {
private _flag: boolean;
canDeactivate() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OpenIdConfiguration, LoginResponse, AuthenticatedResult, ConfigAuthenticatedResult } from 'angular-auth-oidc-client';
import { LoginResponse } from 'angular-auth-oidc-client';
import { LDFlagValue } from 'launchdarkly-js-client-sdk';
import { Observable, of } from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { Component, Output, EventEmitter } from '@angular/core';

@Component({
selector: 'app-sign-out-popup',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { FontAwesomeTestingModule } from '@fortawesome/angular-fontawesome/testing';
import { of } from 'rxjs';
import { FileType } from 'src/app/common/model/file-type';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, DebugElement, EventEmitter, Input, NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { Component, DebugElement, EventEmitter, Input } from '@angular/core';
import { ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Subject, of, takeUntil } from 'rxjs';
import { of } from 'rxjs';
import { UserIdentityService } from '../services/user-identity.service';
import { FontAwesomeTestingModule } from '@fortawesome/angular-fontawesome/testing';
import { WorkAllocationComponent } from './work-allocation.component';
Expand Down
Loading