Skip to content

Commit

Permalink
Vue Fold in Prep: Linting Fixes (#1633)
Browse files Browse the repository at this point in the history
* ongoing Linting

* Lint Fixes

* no gutters update

* MakeModel Test Fix
  • Loading branch information
cameron-eyds authored Nov 28, 2023
1 parent ab654dd commit 97089eb
Show file tree
Hide file tree
Showing 134 changed files with 567 additions and 532 deletions.
7 changes: 5 additions & 2 deletions ppr-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = {
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'object-curly-spacing': ['error', 'always'],
'standard/computed-property-even-spacing': 'off',
'vue/multi-word-component-names': 'off',
Expand All @@ -23,11 +25,12 @@ module.exports = {
'vue/require-explicit-emits': 'error',
'vue/require-default-prop': 'error',
'vue/require-prop-types': 'error',
'vue/no-template-shadow': 'error',
'vue/no-template-shadow': 'off',
'vue/attribute-hyphenation': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/prop-name-casing': ['error', 'camelCase'],
'vue/custom-event-name-casing': ['error', 'camelCase']
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/no-v-html': 'off'
},
parser: 'vue-eslint-parser',
parserOptions: {
Expand Down
20 changes: 10 additions & 10 deletions ppr-ui/src/components/collateral/Collateral.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
v-if="summaryView || registrationFlowType == RegistrationFlowType.AMENDMENT"
id="collateral-component"
fluid
class="bg-white pa-0 rounded-bottom no-gutters"
class="bg-white pa-0 rounded-bottom noGutters"
:class="!valid && registrationFlowType !== RegistrationFlowType.AMENDMENT ? '' : 'pb-10'"
>
<v-card
Expand Down Expand Up @@ -63,7 +63,7 @@
<v-container
v-else
id="collateral-edit"
class="pa-0 no-gutters"
class="pa-0 noGutters"
fluid
>
<v-row noGutters>
Expand Down Expand Up @@ -121,16 +121,12 @@ import {
} from 'vue'
import { useStore } from '@/store/store'
import { useRouter } from 'vue-router'
// local components
import { GeneralCollateral } from './generalCollateral'
import { VehicleCollateral } from './vehicleCollateral'
// local types/resources/etc.
import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars
import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums'
import {
AddCollateralIF, // eslint-disable-line no-unused-vars
GeneralCollateralIF, // eslint-disable-line no-unused-vars
VehicleCollateralIF // eslint-disable-line no-unused-vars
AddCollateralIF,
GeneralCollateralIF,
} from '@/interfaces'
import { useGeneralCollateral } from './generalCollateral/factories'
import { useVehicle } from './vehicleCollateral/factories'
Expand All @@ -152,6 +148,10 @@ export default defineComponent({
default: false
}
},
emits: [
'setCollateralValid',
'collateralOpen'
],
setup (props, context) {
const router = useRouter()
const {
Expand Down Expand Up @@ -291,7 +291,7 @@ export default defineComponent({
localState.summaryView = val
})
watch(() => localState.collateral.vehicleCollateral, (val: VehicleCollateralIF[]) => {
watch(() => localState.collateral.vehicleCollateral, () => {
if ((vehiclesValid() || localState.collateral?.generalCollateral?.length > 0 ||
registrationType === APIRegistrationTypes.TRANSITION_TAX_LIEN) &&
// vehicle collateral is optional for Income Tax registration type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ export default defineComponent({
default: false
}
},
emits: [
'closeGenColAmend'
],
setup (props, { emit }) {
const { setGeneralCollateral } = useStore()
const { getGeneralCollateral, isTiptapEnabled } = storeToRefs(useStore())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import {
} from 'vue'
import { useStore } from '@/store/store'
// local
import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars
import { GeneralCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { APIRegistrationTypes, RegistrationFlowType } from '@/enums'
import { GeneralCollateralIF } from '@/interfaces'
import { storeToRefs } from 'pinia'
import { WysiwygEditor } from '@/components/common'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ import {
computed
} from 'vue'
import { useStore } from '@/store/store'
// local
import { RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars
import { GeneralCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { RegistrationFlowType } from '@/enums'
import { GeneralCollateralIF } from '@/interfaces'
import { pacificDate } from '@/utils'
import { cloneDeep } from 'lodash'
import { storeToRefs } from 'pinia'
Expand All @@ -285,6 +284,9 @@ export default defineComponent({
default: false
}
},
emits: [
'initGenColAmend'
],
setup (props, { emit }) {
const { setGeneralCollateral } = useStore()
const { getGeneralCollateral, getOriginalAddCollateral, getRegistrationFlowType } = storeToRefs(useStore())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
// local components
import { GenColEdit, GenColSummary, GenColAmend } from '.'
// local types/helpers/etc.
import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars
import { APIRegistrationTypes, RegistrationFlowType } from '@/enums'
import { useStore } from '@/store/store'
import { storeToRefs } from 'pinia'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

<v-container
v-else
class="no-gutters"
class="noGutters"
:class="containerClass"
fluid
>
Expand Down Expand Up @@ -415,11 +415,9 @@ import {
toRefs
} from 'vue'
import { useStore } from '@/store/store'
// local components
import { EditCollateral } from '.'
// local types/etc.
import { ActionTypes, APIVehicleTypes, RegistrationFlowType, APIRegistrationTypes } from '@/enums'
import { VehicleCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { VehicleCollateralIF } from '@/interfaces'
import { vehicleTableHeaders, VehicleTypes } from '@/resources'
import { useVehicle } from './factories/useVehicle'
import { cloneDeep } from 'lodash'
Expand All @@ -443,6 +441,9 @@ export default defineComponent({
default: false
}
},
emits: [
'collateralOpen'
],
setup (props, context) {
const { setVehicleCollateral } = useStore()
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ const validationSchema = {
]
}
}
// @ts-ignore - there is a type mismatch in the structure above, but it still works
// @ts-ignore
export const formValidation = createFormValidation(validationSchema)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { reactive, toRefs, computed } from 'vue'
import { VehicleTypes, VehicleTypesNoMH } from '@/resources'
import { VehicleCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { VehicleCollateralIF } from '@/interfaces'
import { useStore } from '@/store/store'
import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums'
import { cloneDeep, isEqual } from 'lodash'
Expand Down
3 changes: 1 addition & 2 deletions ppr-ui/src/components/common/AccountInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<v-tooltip
if="tooltipContent"
location="top"
nudgeRight="3"
contentClass="top-tooltip pa-5"
transition="fade-transition"
data-test-id="submitting-party-tooltip"
Expand Down Expand Up @@ -89,7 +88,7 @@ import { BaseAddress } from '@/composables/address'
import { PartyAddressSchema } from '@/schemas'
import { defineComponent } from 'vue'
import { toDisplayPhone } from '@/utils'
import { AccountInfoIF, PartyIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { AccountInfoIF } from '@/interfaces'
export default defineComponent({
name: 'AccountInfo',
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/ButtonFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default defineComponent({
return statement
}, 2000, { trailing: false })
watch(() => props.forceSave, (val: boolean) => {
watch(() => props.forceSave, () => {
// on change (T/F doesn't matter), save and go back to dash
submitSaveResume()
})
Expand Down
5 changes: 4 additions & 1 deletion ppr-ui/src/components/common/CautionBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import { defineComponent } from 'vue'
export default defineComponent({
name: 'CautionBox',
props: {
setMsg: String,
setMsg: {
type: String,
default: ''
},
setImportantWord: {
type: String,
default: 'Important'
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/CertifyInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ import { useStore } from '@/store/store'
import { convertDate, getRegisteringPartyFromAuth } from '@/utils'
import { BaseAddress } from '@/composables/address'
import { DefaultSchema } from '@/composables/address/resources'
import { CertifyIF, ContentIF, PartyIF } from '@/interfaces' // eslint-disable-line no-unused-vars
import { CertifyIF, ContentIF, PartyIF } from '@/interfaces'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import { storeToRefs } from 'pinia'
import { authorizedTableHeaders } from '@/resources'
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/CourtOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<v-container
v-else
fluid
class="pb-6 px-0 rounded no-gutters"
class="pb-6 px-0 rounded noGutters"
>
<v-card
id="court-order"
Expand Down
16 changes: 13 additions & 3 deletions ppr-ui/src/components/common/DischargeConfirmSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,20 @@ import { UIRegistrationTypes } from '@/enums'
export default defineComponent({
name: 'DischargeConfirmSummary',
props: {
setRegNum: String,
setRegType: String,
setCollateralSummary: String,
setRegNum: {
type: String,
default: ''
},
setRegType: {
type: String,
default: ''
},
setCollateralSummary: {
type: String,
default: ''
},
setShowErrors: {
type: Boolean,
default: false
}
},
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/components/common/DocumentId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export default defineComponent({
},
sectionNumber: {
type: Number,
required: false
required: false,
default: null
},
content: {
type: Object as () => ContentIF,
Expand Down
8 changes: 4 additions & 4 deletions ppr-ui/src/components/common/FolioNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default defineComponent({
default: ''
}
},
emits: ['folio-number', 'folio-error'],
emits: ['folioNumber', 'folioError'],
setup (props, { emit }) {
const localState = reactive({
folioEdit: false,
Expand All @@ -35,16 +35,16 @@ export default defineComponent({
watch(() => localState.folioEditNumber, (val: string) => {
if (val?.length > 15) {
localState.folioEditError = 'Maximum 15 characters reached'
emit('folio-error', true)
emit('folioError', true)
} else {
localState.folioEditError = ''
localState.folioEditHint = `${15 - val?.length}`
localState.folioNumber = localState.folioEditNumber
emit('folio-error', false)
emit('folioError', false)
}
})
watch(() => localState.folioNumber, (val: string) => {
emit('folio-number', val)
emit('folioNumber', val)
})
// when enter pressed on the folio number, either focus on the input or the button if the input is disabled
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/FolioOrReferenceNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineComponent({
},
sectionNumber: {
type: Number,
required: false
default: null
},
validate: {
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineComponent({
},
initialValue: {
type: String,
required: false
default: ''
},
inputTitle: {
type: String,
Expand Down
5 changes: 2 additions & 3 deletions ppr-ui/src/components/common/HomeLocationInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
v-model="locationInfo.exceptionPlan"
variant="filled"
label="Except Plan"
height="100"
:rules="maxLength(80)"
persistentHint
/>
Expand All @@ -231,13 +230,13 @@
</template>

<script lang="ts">
/* eslint-disable no-unused-vars */
import { computed, defineComponent, onMounted, reactive, ref, toRefs, watch } from 'vue'
import { FormIF, MhrLocationInfoIF } from '@/interfaces'
import { useInputRules } from '@/composables/useInputRules'
import { useStore } from '@/store/store'
import { storeToRefs } from 'pinia'
/* eslint-disable no-unused-vars */
export default defineComponent({
name: 'HomeLocationInfo',
Expand Down
5 changes: 1 addition & 4 deletions ppr-ui/src/components/common/LienAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Lien Information -->
<v-row
id="lien-information"
no-gutters
noGutters
class="pt-10"
>
<v-card
Expand Down Expand Up @@ -59,9 +59,6 @@ import {
export default defineComponent({
name: 'LienAlert',
props: {
setEndDate: { type: String }
},
emits: ['isLoading'],
setup (props, { emit }) {
const router = useRouter()
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/src/components/common/OrgNameLookup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:nilSearchText="nilSearchText"
:searchValue="autoCompleteSearchValue"
:setAutoCompleteIsActive="autoCompleteIsActive"
@search-value="setSearchValue"
@searchValue="setSearchValue"
@searching="loadingSearchResults = $event"
/>
</div>
Expand All @@ -47,7 +47,7 @@ export default defineComponent({
baseValue: { type: String, default: '' },
fieldLabel: { type: String, default: 'Find or enter the Full Legal Name of the Business' },
fieldHint: { type: String, default: '' },
orgNameRules: { type: Array as () => Array<Function>, default: () => [] },
orgNameRules: { type: Array as () => Array<(v:any)=>string|boolean>, default: () => [] },
nilSearchText: {
type: String,
default: 'Ensure you have entered the correct, full legal name of the organization before entering the phone' +
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/src/components/common/PidNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</template>

<script lang="ts">
/* eslint-disable no-unused-vars */
import { computed, defineComponent, nextTick, reactive, ref, toRefs, watch } from 'vue'
import { useStore } from '@/store/store'
import { useInputRules } from '@/composables'
Expand All @@ -108,7 +108,7 @@ import { pidNotFoundDialog } from '@/resources/dialogOptions'
import { LtsaDetailsIF, PidInfoIF } from '@/interfaces/ltsa-api-interfaces'
import { FormIF } from '@/interfaces'
import { storeToRefs } from 'pinia'
/* eslint-enable no-unused-vars */
export default defineComponent({
name: 'PidNumber',
Expand Down
Loading

0 comments on commit 97089eb

Please sign in to comment.