From 040c1e3a6a59423fa88972c0284a93e8fcee40a2 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 14 Sep 2022 10:42:36 -0700 Subject: [PATCH] - lint fixes --- src/interfaces/payment-interfaces/fees-interface.ts | 11 ++++++----- .../create-share-structure-interface.ts | 10 +++++----- src/mixins/add-edit-org-person-mixin.ts | 8 ++++++-- src/mixins/filing-template-mixin.ts | 3 ++- src/router/router.ts | 1 + src/services/legal-services.ts | 1 + src/store/getters/state-getters.ts | 1 + tests/unit/Actions.spec.ts | 1 - tests/unit/AddNameTranslation.spec.ts | 4 ---- tests/unit/BusinessTypeConfirm.spec.ts | 1 - tests/unit/CompleteResolution.spec.ts | 1 - tests/unit/DissolutionFirm.spec.ts | 2 +- tests/unit/DissolutionReviewConfirm.spec.ts | 3 --- tests/unit/IncorporationDateTime.spec.ts | 2 +- tests/unit/ListNameTranslations.spec.ts | 4 ---- tests/unit/RegAddEditOrgPerson.spec.ts | 1 - tests/unit/RegistrationReviewConfirm.spec.ts | 5 +---- 17 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/interfaces/payment-interfaces/fees-interface.ts b/src/interfaces/payment-interfaces/fees-interface.ts index 775814569..2c882aa9e 100644 --- a/src/interfaces/payment-interfaces/fees-interface.ts +++ b/src/interfaces/payment-interfaces/fees-interface.ts @@ -1,4 +1,10 @@ /** Interfaces for Fees from Payment API. */ + +export interface TaxesIF { + pst: number + gst: number +} + export interface FeesIF { filingFees: number filingType: string @@ -11,11 +17,6 @@ export interface FeesIF { total?: number } -export interface TaxesIF { - pst: number - gst: number -} - // NB: use cloneDeep when assigning EmptyOrgPerson export const EmptyFees: FeesIF = { filingFees: null, diff --git a/src/interfaces/stepper-interfaces/CreateShareStructure/create-share-structure-interface.ts b/src/interfaces/stepper-interfaces/CreateShareStructure/create-share-structure-interface.ts index f3f95adfc..406c13a00 100644 --- a/src/interfaces/stepper-interfaces/CreateShareStructure/create-share-structure-interface.ts +++ b/src/interfaces/stepper-interfaces/CreateShareStructure/create-share-structure-interface.ts @@ -1,8 +1,3 @@ -export interface ShareStructureIF { - valid: boolean - shareClasses: ShareClassIF[] -} - export interface ShareClassIF { id: string type?: string // 'Class' or 'Series' @@ -17,6 +12,11 @@ export interface ShareClassIF { series?: ShareClassIF[] } +export interface ShareStructureIF { + valid: boolean + shareClasses: ShareClassIF[] +} + export const NewShareClass: ShareClassIF = { id: null, type: 'Class', diff --git a/src/mixins/add-edit-org-person-mixin.ts b/src/mixins/add-edit-org-person-mixin.ts index 2024d22f5..e4d55950c 100644 --- a/src/mixins/add-edit-org-person-mixin.ts +++ b/src/mixins/add-edit-org-person-mixin.ts @@ -502,13 +502,17 @@ export default class AddEditOrgPersonMixin extends Vue { // Event emitters @Emit('addEditPerson') - private emitPersonInfo (personInfo: OrgPersonIF): void {} + private emitPersonInfo (personInfo: OrgPersonIF): OrgPersonIF { + return personInfo + } @Emit('resetEvent') private emitResetEvent (): void {} @Emit('removePerson') - protected emitRemovePerson (activeIndex: number): void {} + protected emitRemovePerson (activeIndex: number): number { + return activeIndex + } @Emit('removeCompletingPartyRole') private emitReassignCompletingPartyEvent (): void {} diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index 4e1f5f437..f2b2041cc 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -250,7 +250,7 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { // conditionally restore the entity-specific sections switch (this.getEntityType) { - case CorpTypeCd.COOP: + case CorpTypeCd.COOP: { // restore Cooperative type this.setCooperativeType(draftFiling.incorporationApplication.cooperative?.cooperativeAssociationType) @@ -295,6 +295,7 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { this.setMemorandum(createMemorandum) break + } case CorpTypeCd.BENEFIT_COMPANY: case CorpTypeCd.BC_CCC: case CorpTypeCd.BC_COMPANY: diff --git a/src/router/router.ts b/src/router/router.ts index bd4c99eb7..a17e0aa64 100644 --- a/src/router/router.ts +++ b/src/router/router.ts @@ -14,6 +14,7 @@ export function getVueRouter () { // set base URL for Vue Router base: sessionStorage.getItem('VUE_ROUTER_BASE'), routes, + // eslint-disable-next-line @typescript-eslint/no-unused-vars scrollBehavior (to, from, savedPosition) { // see https://router.vuejs.org/guide/advanced/scroll-behavior.html return { x: 0, y: 0 } diff --git a/src/services/legal-services.ts b/src/services/legal-services.ts index ef7561f9a..e202edf08 100644 --- a/src/services/legal-services.ts +++ b/src/services/legal-services.ts @@ -52,6 +52,7 @@ export default class LegalServices { .then(response => { // look for dissolution task const filing = response?.data?.tasks + // eslint-disable-next-line no-prototype-builtins ?.find(x => x.task.filing.hasOwnProperty(FilingTypes.VOLUNTARY_DISSOLUTION))?.task.filing const filingName = filing?.header?.name const filingId = +filing?.header?.filingId || 0 diff --git a/src/store/getters/state-getters.ts b/src/store/getters/state-getters.ts index a9fd62724..08b9329aa 100644 --- a/src/store/getters/state-getters.ts +++ b/src/store/getters/state-getters.ts @@ -292,6 +292,7 @@ export const getBusinessContact = (state: StateIF): ContactPointIF => { } /** The Memorandum object. */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars export const getMemorandum = (state: StateIF): any => { return {} // FUTURE: implement this } diff --git a/tests/unit/Actions.spec.ts b/tests/unit/Actions.spec.ts index 09fe1c433..bd7b7b1c3 100644 --- a/tests/unit/Actions.spec.ts +++ b/tests/unit/Actions.spec.ts @@ -102,7 +102,6 @@ describe('Actions component', () => { describe('Emits error event if NR validation fails in file and pay', () => { let wrapper: any const { assign } = window.location - const effectiveDate = new Date(new Date().setDate(new Date().getDate() + 5)) beforeEach(async () => { // mock the window.location.assign function diff --git a/tests/unit/AddNameTranslation.spec.ts b/tests/unit/AddNameTranslation.spec.ts index c7dcb05e0..976f1c087 100644 --- a/tests/unit/AddNameTranslation.spec.ts +++ b/tests/unit/AddNameTranslation.spec.ts @@ -14,10 +14,6 @@ Vue.use(Vuelidate) const vuetify = new Vuetify({}) const store = getVuexStore() -function resetStore (): void { - store.state.stateModel.nameTranslations = [] -} - // Local references const addTranslationInput = '#name-translation-input' const doneBtn = '#btn-done' diff --git a/tests/unit/BusinessTypeConfirm.spec.ts b/tests/unit/BusinessTypeConfirm.spec.ts index 1275d6779..44bcc33e4 100644 --- a/tests/unit/BusinessTypeConfirm.spec.ts +++ b/tests/unit/BusinessTypeConfirm.spec.ts @@ -1,5 +1,4 @@ import Vue from 'vue' -import flushPromises from 'flush-promises' import { Wrapper } from '@vue/test-utils' import { getLastEvent } from '../get-last-event' import { wrapperFactory } from '../jest-wrapper-factory' diff --git a/tests/unit/CompleteResolution.spec.ts b/tests/unit/CompleteResolution.spec.ts index 8611f2128..53fc296a0 100644 --- a/tests/unit/CompleteResolution.spec.ts +++ b/tests/unit/CompleteResolution.spec.ts @@ -1,4 +1,3 @@ -import Vue from 'vue' import { wrapperFactory } from '../jest-wrapper-factory' import CompleteResolution from '@/components/Dissolution/CompleteResolution.vue' import { DissolutionResources } from '@/resources' diff --git a/tests/unit/DissolutionFirm.spec.ts b/tests/unit/DissolutionFirm.spec.ts index b6195fd8d..028a33a0e 100644 --- a/tests/unit/DissolutionFirm.spec.ts +++ b/tests/unit/DissolutionFirm.spec.ts @@ -1,6 +1,6 @@ import Vuetify from 'vuetify' import { shallowWrapperFactory } from '../jest-wrapper-factory' -import { mount, shallowMount } from '@vue/test-utils' +import { mount } from '@vue/test-utils' import { getVuexStore } from '@/store' import DissolutionFirm from '@/views/DissolutionFirm/DissolutionFirm.vue' import { DissolutionResources } from '@/resources/' diff --git a/tests/unit/DissolutionReviewConfirm.spec.ts b/tests/unit/DissolutionReviewConfirm.spec.ts index 62ec58d7e..6c6f5bd5a 100644 --- a/tests/unit/DissolutionReviewConfirm.spec.ts +++ b/tests/unit/DissolutionReviewConfirm.spec.ts @@ -1,10 +1,7 @@ import { shallowWrapperFactory, wrapperFactory } from '../jest-wrapper-factory' -import { getVuexStore } from '@/store' import DissolutionReviewConfirm from '@/views/Dissolution/DissolutionReviewConfirm.vue' import { DissolutionResources } from '@/resources/' -const store = getVuexStore() - // Test Case Data const reviewConfirmTestCases = [ { diff --git a/tests/unit/IncorporationDateTime.spec.ts b/tests/unit/IncorporationDateTime.spec.ts index b5934bedd..7c340fad6 100644 --- a/tests/unit/IncorporationDateTime.spec.ts +++ b/tests/unit/IncorporationDateTime.spec.ts @@ -6,7 +6,7 @@ import { getLastEvent } from '../get-last-event' import { getVuexStore } from '@/store' // Utils -import { createLocalVue, mount, Wrapper } from '@vue/test-utils' +import { createLocalVue, mount } from '@vue/test-utils' // Components import IncorporationDateTime from '@/components/Incorporation/IncorporationDateTime.vue' diff --git a/tests/unit/ListNameTranslations.spec.ts b/tests/unit/ListNameTranslations.spec.ts index c36d043d7..0bce5c62d 100644 --- a/tests/unit/ListNameTranslations.spec.ts +++ b/tests/unit/ListNameTranslations.spec.ts @@ -15,10 +15,6 @@ const vuetify = new Vuetify({}) const store = getVuexStore() document.body.setAttribute('data-app', 'true') -function resetStore (): void { - store.state.stateModel.nameTranslations = [] -} - // Local references const nameTranslationsUi = '#name-translations-list' const nameTranslationsList = [ diff --git a/tests/unit/RegAddEditOrgPerson.spec.ts b/tests/unit/RegAddEditOrgPerson.spec.ts index ac2b9428b..d88b4f966 100644 --- a/tests/unit/RegAddEditOrgPerson.spec.ts +++ b/tests/unit/RegAddEditOrgPerson.spec.ts @@ -29,7 +29,6 @@ const middleNameSelector = '.middle-name' const lastNameSelector = '.last-name' const confirmCheckboxSelector = '.confirm-checkbox' const orgNameSelector = '.org-name' -const businessNumberSelector = '.business-number' const emailAddressSelector = '.email-address' const buttonRemoveSelector = '.btn-remove' const buttonDoneSelector = '.btn-done' diff --git a/tests/unit/RegistrationReviewConfirm.spec.ts b/tests/unit/RegistrationReviewConfirm.spec.ts index 3c6908ca4..1f5fc2443 100644 --- a/tests/unit/RegistrationReviewConfirm.spec.ts +++ b/tests/unit/RegistrationReviewConfirm.spec.ts @@ -1,10 +1,7 @@ -import { shallowWrapperFactory, wrapperFactory } from '../jest-wrapper-factory' -import { getVuexStore } from '@/store' +import { shallowWrapperFactory } from '../jest-wrapper-factory' import { RegistrationReviewConfirm } from '@/views' import { RegistrationResources } from '@/resources' -const store = getVuexStore() - // Test Case Data const reviewConfirmTestCases = [ {