Skip to content

Commit

Permalink
chore: fix & elide typescript errors; error fail CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
scally committed Feb 24, 2025
1 parent 9195fd7 commit e89c214
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"./CHANGELOG.md"
],
"scripts": {
"build": "npm run build:clean && npm run generate && vite build",
"build": "npm run build:clean && npm run generate && npm run tsc && vite build",
"build:clean": "rm -rf ./dist && mkdir ./dist",
"commitlint": "commitlint --edit",
"dev": "node ./build/prompt.js && npm run build && vite build --watch",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Common/TaxInputs/TaxInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function SelectInput({ question, requirement, control }: EmpQ | CompR) {
<Select
control={control}
name={key as string}
// @ts-expect-error HACK value is insufficiently narrowed here
defaultSelectedKey={value}
label={label}
description={description}
Expand All @@ -60,6 +61,7 @@ export function TextInput({ question, requirement, control }: EmpQ | CompR) {
control={control}
name={key as string}
label={label}
// @ts-expect-error HACK value is insufficiently narrowed here
defaultValue={value}
description={description}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useTranslation } from 'react-i18next'

export function Head() {
// @ts-expect-error HACK missing translations
const { t } = useTranslation('Company.DocumentSigner')

return <h2>{t('documentListTitle')}</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useDocumentList } from './DocumentList'
function List() {
const { companyForms, handleRequestFormToSign, documentListError, isSelfSignatory } =
useDocumentList()
// @ts-expect-error HACK missing translations
const { t } = useTranslation('Company.DocumentSigner')

const onRequestSign = (requestedForm: FormData) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function isValidSignatoryTitle(
}

function ManageSignatories() {
// @ts-expect-error HACK missing translations
const { t } = useTranslation('Company.DocumentSigner')
const { isSelfSignatory, signatory, handleChangeSignatory } = useDocumentList()

Expand Down
4 changes: 3 additions & 1 deletion src/components/Employee/EmployeeList/EmployeeList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { handleGetCompanyEmployees } from '@/test/mocks/apis/employees'
import { HttpResponse } from 'msw'
import { mockResizeObserver } from 'jsdom-testing-mocks'

const resizeObserver = mockResizeObserver()
beforeEach(() => {
mockResizeObserver()
})

describe('EmployeeList', () => {
beforeEach(() => {
Expand Down
1 change: 1 addition & 0 deletions src/components/Employee/EmployeeList/EmployeeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function Root({ companyId, className, children }: EmployeeListProps) {
handleNew,
handleReview,
handleDelete,
// @ts-expect-error HACK fix employee typing inconsistency
employees,
currentPage,
totalPages,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Employee/EmployeeList/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const List = () => {
} = useEmployeeList()

const { t } = useTranslation('Employee.EmployeeList')
const [deleting, setDeleting] = useState<Set<string>>(new Set())
const [_, setDeleting] = useState<Set<string>>(new Set())
const { ...dataViewProps } = useDataView({
data: employees,
columns: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/Employee/Profile/Actions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next'
import { ActionsLayout, Button, Flex } from '@/components/Common'
import { ActionsLayout, Button } from '@/components/Common'
import { useProfile } from '@/components/Employee/Profile/Profile'

export const Actions = () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/Employee/Profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ const Root = ({ isAdmin = false, ...props }: ProfileProps) => {
const workAddressData = await mutateEmployeeWorkAddress({
work_address_uuid: mergedData.current.workAddress.uuid,
body: {
// @ts-expect-error HACK fix disagreement between args and API expectation
version: mergedData.current.workAddress.version,
location_uuid: work_address,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { transition, reduce, state } from 'robot3'
import { componentEvents } from '@/shared/constants'
import type { EmployeeSelfOnboardingContextInterface } from '@/components/Flow/EmployeeSelfOnboardingFlow'
import {
Profile,
Taxes,
Expand All @@ -9,6 +8,7 @@ import {
OnboardingSummary,
} from '@/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents'
import { SDKI18next } from '@/contexts'
import { EmployeeSelfOnboardingContextInterface } from '@/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow'

export const employeeSelfOnboardingMachine = {
index: state(
Expand Down
1 change: 1 addition & 0 deletions src/contexts/ThemeProvider/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
}, [partnerTheme, t])

return (
// @ts-expect-error HACK fix mismatch where containerRef allows null
<ThemeContext.Provider value={{ container: containerRef }}>
<section className="GSDK" data-testid="GSDK" ref={containerRef}>
{children}
Expand Down
1 change: 1 addition & 0 deletions src/test/mocks/apis/homeAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const getEmployeeHomeAddresses = http.get<
const createEmployeeHomeAddress = http.post<
PathParams<'post-v1-employees-employee_id-home_addresses'>,
RequestBodyParams<'post-v1-employees-employee_id-home_addresses'>,
// @ts-expect-error HACK re-check after Speakeasy implementation
ResponseType<'post-v1-employees-employee_id-home_addresses', 200>
>(`${API_BASE_URL}/v1/employees/:employee_id/home_addresses`, async ({ request }) => {
const requestBody = await request.json()
Expand Down
1 change: 1 addition & 0 deletions src/test/mocks/apis/typeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { operations } from '@/types/schema'
// Type Helpers
export type PathParams<Operation extends keyof operations> =
operations[Operation]['parameters']['path']
// @ts-expect-error HACK revisit after Speakeasy implementation
export type RequestBodyParams<Operation extends keyof operations> = NonNullable<
operations[Operation]['requestBody']
>['content']['application/json']
Expand Down
1 change: 1 addition & 0 deletions src/test/mocks/fixtures/company_location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const COMPANY_LOCATION_FORM_PAYLOAD = {
city: 'Anytown',
state: 'ABC',
zip: '12345',
// @ts-expect-error HACK fix `country` typings
country: 'USA',
mailing_address: true,
filing_address: false,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"module": "ESNext",
"moduleDetection": "force",
"allowJs": true,
"noEmit": false,
"noEmit": true,
"jsx": "react-jsx",
"moduleResolution": "bundler",
"resolveJsonModule": true,
Expand Down

0 comments on commit e89c214

Please sign in to comment.