Skip to content

Commit

Permalink
fix: cleanup lint warnings (#4404)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan authored Oct 17, 2024
1 parent 1e317dd commit 5a0588c
Show file tree
Hide file tree
Showing 37 changed files with 124 additions and 146 deletions.
2 changes: 1 addition & 1 deletion api/src/controllers/reserved-community-type.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
ApiOperation,
ApiTags,
} from '@nestjs/swagger';
import { ReservedCommunityTypeService } from '../services/reserved-community-type.service';
import { ReservedCommunityType } from '../dtos/reserved-community-types/reserved-community-type.dto';
import { ReservedCommunityTypeCreate } from '../dtos/reserved-community-types/reserved-community-type-create.dto';
import { ReservedCommunityTypeUpdate } from '../dtos/reserved-community-types/reserved-community-type-update.dto';
import { ReservedCommunityTypeService } from '../services/reserved-community-type.service';
import { defaultValidationPipeOptions } from '../utilities/default-validation-pipe-options';
import { ReservedCommunityTypeQueryParams } from '../dtos/reserved-community-types/reserved-community-type-query-params.dto';
import { IdDTO } from '../dtos/shared/id.dto';
Expand Down
2 changes: 0 additions & 2 deletions api/src/dtos/applications/public-apps-count.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { Expose } from 'class-transformer';
import { IsNumber, IsDefined } from 'class-validator';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';

export class PublicAppsCount {
@Expose()
Expand Down
2 changes: 1 addition & 1 deletion api/src/dtos/applications/public-apps-filtered.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Expose, Type } from 'class-transformer';
import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
import { ApiProperty, OmitType } from '@nestjs/swagger';
import { Application } from './application.dto';
import Listing from '../listings/listing.dto';

Expand Down
2 changes: 1 addition & 1 deletion api/src/dtos/applications/public-apps-view-params.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Expose, Transform, Type } from 'class-transformer';
import { Expose, Transform } from 'class-transformer';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsEnum, IsOptional, IsString } from 'class-validator';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';
Expand Down
1 change: 0 additions & 1 deletion api/src/dtos/applications/public-apps-view-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Expose, Type } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { ValidateNested } from 'class-validator';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';
import { Application } from './application.dto';
import { PublicAppsCount } from './public-apps-count.dto';
import { PublicAppsFiltered } from './public-apps-filtered.dto';

Expand Down
7 changes: 3 additions & 4 deletions api/src/services/script-runner.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { Application } from '../dtos/applications/application.dto';
import { AmiChartImportDTO } from '../dtos/script-runner/ami-chart-import.dto';
import { AmiChartCreate } from '../dtos/ami-charts/ami-chart-create.dto';
import { AmiChartService } from './ami-chart.service';
import { IdDTO } from '../dtos/shared/id.dto';

/**
this is the service for running scripts
Expand Down Expand Up @@ -204,7 +203,7 @@ export class ScriptRunnerService {
return { success: true };
}

private async addLotteryTranslationsHelper(req: ExpressRequest) {
private async addLotteryTranslationsHelper() {
const updateForLanguage = async (
language: LanguagesEnum,
translationKeys: Record<string, Record<string, string>>,
Expand Down Expand Up @@ -355,7 +354,7 @@ export class ScriptRunnerService {
async addLotteryTranslations(req: ExpressRequest): Promise<SuccessDTO> {
const requestingUser = mapTo(User, req['user']);
await this.markScriptAsRunStart('add lottery translations', requestingUser);
this.addLotteryTranslationsHelper(req);
this.addLotteryTranslationsHelper();
await this.markScriptAsComplete('add lottery translations', requestingUser);

return { success: true };
Expand All @@ -376,7 +375,7 @@ export class ScriptRunnerService {
'add lottery translations create if empty',
requestingUser,
);
this.addLotteryTranslationsHelper(req);
this.addLotteryTranslationsHelper();
await this.markScriptAsComplete(
'add lottery translations create if empty',
requestingUser,
Expand Down
1 change: 0 additions & 1 deletion api/src/services/translation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { PrismaService } from './prisma.service';
import { Listing } from '../dtos/listings/listing.dto';
import { GoogleTranslateService } from './google-translate.service';
import * as lodash from 'lodash';
import { Jurisdiction } from '../dtos/jurisdictions/jurisdiction.dto';

@Injectable()
export class TranslationService {
Expand Down
6 changes: 1 addition & 5 deletions api/src/utilities/lottery-date-validator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ListingEventsTypeEnum,
ReviewOrderTypeEnum,
YesNoEnum,
} from '@prisma/client';
import { ListingEventsTypeEnum, ReviewOrderTypeEnum } from '@prisma/client';
import {
ValidatorConstraint,
ValidatorConstraintInterface,
Expand Down
1 change: 0 additions & 1 deletion api/test/integration/lottery.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
ListingsStatusEnum,
LotteryStatusEnum,
MultiselectQuestionsApplicationSectionEnum,
Prisma,
ReviewOrderTypeEnum,
UnitTypeEnum,
} from '@prisma/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ describe('Testing Permissioning of endpoints as Jurisdictional Admin in the corr
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ describe('Testing Permissioning of endpoints as Jurisdictional Admin in the wron
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ describe('Testing Permissioning of endpoints as logged out user', () => {
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ describe('Testing Permissioning of endpoints as partner with correct listing', (
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ describe('Testing Permissioning of endpoints as partner with wrong listing', ()
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ describe('Testing Permissioning of endpoints as public user', () => {
data: listingData,
});

const res = await request(app.getHttpServer())
await request(app.getHttpServer())
.post('/listings/duplicate')
.set({ passkey: process.env.API_PASS_KEY || '' })
.send({
Expand Down
2 changes: 1 addition & 1 deletion api/test/unit/services/email.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const translationServiceMock = {
};

const jurisdictionServiceMock = {
findOne: (id) => {
findOne: () => {
return { name: 'Jurisdiction 1' };
},
};
Expand Down
2 changes: 0 additions & 2 deletions api/test/unit/services/google-translate.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ jest.mock('@google-cloud/translate/build/src/v2');

describe('GoogleTranslateService', () => {
let service: GoogleTranslateService;
let prisma: PrismaService;

beforeAll(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [PrismaService, GoogleTranslateService],
}).compile();

service = module.get<GoogleTranslateService>(GoogleTranslateService);
prisma = module.get<PrismaService>(PrismaService);
});

describe('isConfigured', () => {
Expand Down
6 changes: 1 addition & 5 deletions api/test/unit/utilities/lottery-date-validator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ListingEventsTypeEnum,
ReviewOrderTypeEnum,
YesNoEnum,
} from '@prisma/client';
import { ListingEventsTypeEnum, ReviewOrderTypeEnum } from '@prisma/client';
import { LotteryDateParamValidator } from '../../../src/utilities/lottery-date-validator';

describe('Testing OrderQueryParamValidator', () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"test:shared:helpers": "cd shared-helpers && yarn && yarn test",
"test:apps": "concurrently \"yarn dev:backend\" \"yarn test:app:public\"",
"test:apps:headless": "concurrently \"yarn dev:backend\" \"yarn test:app:public:headless\"",
"lint": "eslint '**/*.ts' '**/*.tsx' '**/*.js' && cd api && yarn lint",
"lint": "eslint '**/*.ts' '**/*.tsx' '**/*.js' --max-warnings 40 && cd api && yarn lint --max-warnings 2",
"test:backend:new": "cd api && yarn test --detectOpenHandles",
"test:backend:new:e2e": "cd api && yarn jest --config ./test/jest-e2e.config.js --detectOpenHandles",
"test:backend:new:cov": "cd api && yarn jest --config ./test/jest-with-coverage.config.js --detectOpenHandles --logHeapUsage",
Expand Down Expand Up @@ -89,7 +89,7 @@
}
},
"lint-staged": {
"*.{js,ts,tsx}": "eslint --max-warnings 100"
"*.{js,ts,tsx}": "eslint"
},
"dependencies": {}
}
1 change: 0 additions & 1 deletion shared-helpers/src/views/CustomIcons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { t } from "@bloom-housing/ui-components"
import React from "react"

export const Application = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { CardSection } from "@bloom-housing/ui-seeds/src/blocks/Card"
import { NetworkErrorReset, NetworkStatusContent } from "../../auth/catchNetworkError"
import type { UseFormMethods } from "react-hook-form"
import BloomCard from "../components/BloomCard"
import { BloomCard } from "../components/BloomCard"
import { emailRegex } from "../../utilities/regex"
import styles from "./FormForgotPassword.module.scss"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LatitudeLongitude } from "@bloom-housing/ui-components"
import AdditionalMetadataFormatter from "../../../src/lib/listings/AdditionalMetadataFormatter"
import { FormListing, FormMetadata } from "../../../src/lib/listings/formTypes"
import { FormMetadata } from "../../../src/lib/listings/formTypes"

const latLong: LatitudeLongitude = {
latitude: 37.36537,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function compareStrings(a, b, node, nextNode, isInverted) {
}
}

export function getColDefs(maxHouseholdSize: number, countyCode: string) {
export function getColDefs(maxHouseholdSize: number) {
const defs = [
{
headerName: t("application.details.submittedDate"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react"
import { Form, t, Textarea } from "@bloom-housing/ui-components"
import { Button, Dialog } from "@bloom-housing/ui-seeds"
import { useForm } from "react-hook-form"
import { FormListing } from "../../../../lib/listings/formTypes"
import { ListingsStatusEnum } from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import { SubmitFunction } from "../index"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useCallback, useContext, useEffect } from "react"
import { useRouter } from "next/router"
import dayjs from "dayjs"
import { t, Form, AlertBox, LoadingOverlay, LatitudeLongitude } from "@bloom-housing/ui-components"
import { Button, Dialog, Icon, Tabs } from "@bloom-housing/ui-seeds"
import { Button, Icon, Tabs } from "@bloom-housing/ui-seeds"
import ChevronLeftIcon from "@heroicons/react/20/solid/ChevronLeftIcon"
import ChevronRightIcon from "@heroicons/react/20/solid/ChevronRightIcon"
import { AuthContext, MessageContext, listingSectionQuestions } from "@bloom-housing/shared-helpers"
Expand Down
1 change: 0 additions & 1 deletion sites/partners/src/components/shared/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
TabNavItem,
AppearanceSizeType,
NavigationContext,
t,
} from "@bloom-housing/ui-components"
import styles from "./NavigationHeader.module.scss"

Expand Down
2 changes: 1 addition & 1 deletion sites/partners/src/components/users/FormUserConfirm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useRef, useContext, useEffect, useState } from "react"
import { useRouter } from "next/router"
import { t, FormCard, Form, Field, useMutate, AlertBox, Modal } from "@bloom-housing/ui-components"
import { t, FormCard, Form, Field, useMutate, AlertBox } from "@bloom-housing/ui-components"
import { Button, Dialog, Icon } from "@bloom-housing/ui-seeds"
import { AuthContext, MessageContext, passwordRegex } from "@bloom-housing/shared-helpers"
import { useForm } from "react-hook-form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
mapCheckboxesToApi,
} from "@bloom-housing/shared-helpers"
import { FormTypes, ApplicationTypes, Address } from "../../lib/applications/FormTypes"
import { convertDataToLocal } from "../../lib/helpers"

import dayjs from "dayjs"
import utc from "dayjs/plugin/utc"
Expand Down
5 changes: 2 additions & 3 deletions sites/partners/src/pages/listings/[id]/applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const ApplicationsList = () => {
!!process.env.applicationExportAsSpreadsheet
)

const countyCode = listingDto?.jurisdictions?.name
const listingName = listingDto?.name
const isListingOpen = listingDto?.status === "active"
const { data: flaggedApps } = useFlaggedApplicationsList({
Expand Down Expand Up @@ -103,8 +102,8 @@ const ApplicationsList = () => {
}, [applications])

const columnDefs = useMemo(() => {
return getColDefs(maxHouseholdSize, countyCode)
}, [maxHouseholdSize, countyCode])
return getColDefs(maxHouseholdSize)
}, [maxHouseholdSize])

const gridComponents = {
formatLinkCell,
Expand Down
1 change: 0 additions & 1 deletion sites/partners/src/pages/listings/[id]/lottery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import advancedFormat from "dayjs/plugin/advancedFormat"
import Ticket from "@heroicons/react/24/solid/TicketIcon"
import Download from "@heroicons/react/24/solid/ArrowDownTrayIcon"
import ExclamationCirleIcon from "@heroicons/react/24/solid/ExclamationCircleIcon"
import Markdown from "markdown-to-jsx"
import { t, Breadcrumbs, BreadcrumbLink } from "@bloom-housing/ui-components"
import { Button, Card, Dialog, Heading, Icon, Message } from "@bloom-housing/ui-seeds"
import { CardHeader, CardSection } from "@bloom-housing/ui-seeds/src/blocks/Card"
Expand Down
1 change: 0 additions & 1 deletion sites/public/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
contactPreferencesCheckboxesOrder,
alternateContactTypeRadioOrder,
howDidYouHearCheckboxesOrder,
raceCheckboxesOrder,
} from "./../mockData/applicationData"

Cypress.Commands.add("signIn", (email, password) => {
Expand Down
2 changes: 1 addition & 1 deletion sites/public/src/components/account/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useForm } from "react-hook-form"
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ConfirmationModalProps {}

const ConfirmationModal = (props: ConfirmationModalProps) => {
const ConfirmationModal = () => {
const { resendConfirmation, profile, confirmAccount } = useContext(AuthContext)
const toastyRef = useToastyRef()
const [openModal, setOpenModal] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { HouseholdMemberForm } from "../../../components/applications/HouseholdM
import { useFormConductor } from "../../../lib/hooks"
import { UserStatus } from "../../../lib/constants"
import ApplicationFormLayout from "../../../layouts/application-form"
import styles from "../../../layouts/application-form.module.scss"

const ApplicationAddMembers = () => {
const { profile } = useContext(AuthContext)
Expand Down
4 changes: 1 addition & 3 deletions sites/public/src/pages/applications/preferences/general.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from "react"
import React, { useContext, useEffect } from "react"
import { useForm } from "react-hook-form"
import { t, Form } from "@bloom-housing/ui-components"
import {
Expand All @@ -16,7 +16,6 @@ import ApplicationFormLayout from "../../../layouts/application-form"

const ApplicationPreferencesGeneral = () => {
const { profile } = useContext(AuthContext)
const [hideReviewButton, setHideReviewButton] = useState(false)
const { conductor, application, listing } = useFormConductor("generalPool")
const currentPageSection = listingSectionQuestions(
listing,
Expand All @@ -27,7 +26,6 @@ const ApplicationPreferencesGeneral = () => {

const { handleSubmit } = useForm()
const onSubmit = () => {
if (!conductor.canJumpForwardToReview()) setHideReviewButton(true)
conductor.completeSection(4)
conductor.sync()
conductor.routeToNextOrReturnUrl()
Expand Down
6 changes: 1 addition & 5 deletions sites/public/src/pages/applications/start/autofill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import { useFormConductor } from "../../../lib/hooks"
import FormSummaryDetails from "../../../components/shared/FormSummaryDetails"
import AutofillCleaner from "../../../lib/applications/appAutofill"
import { UserStatus } from "../../../lib/constants"
import {
Application,
ApplicationOrderByKeys,
OrderByEnum,
} from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import { Application } from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import ApplicationFormLayout from "../../../layouts/application-form"
import { Button } from "@bloom-housing/ui-seeds"
import { CardSection } from "@bloom-housing/ui-seeds/src/blocks/Card"
Expand Down
6 changes: 1 addition & 5 deletions sites/public/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from "react"
import React, { useContext, useEffect } from "react"
import Head from "next/head"
import { t, ActionBlock } from "@bloom-housing/ui-components"
import { Button, Heading, Icon } from "@bloom-housing/ui-seeds"
Expand All @@ -16,10 +16,6 @@ interface IndexProps {
}

export default function Home(props: IndexProps) {
const blankAlertInfo = {
alertMessage: null,
alertType: null,
}
const { profile } = useContext(AuthContext)

useEffect(() => {
Expand Down
Loading

0 comments on commit 5a0588c

Please sign in to comment.