Skip to content

Commit

Permalink
fix some lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
breeg554 committed Dec 2, 2024
1 parent ef7c15e commit c84480c
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 17 deletions.
2 changes: 2 additions & 0 deletions apps/web-remix/app/components/chat/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ function Image({
<a
href={rest.src}
target="_blank"
rel="noreferrer"
className="relative w-fit inline-block my-1 group overflow-hidden rounded-md bg-primary/10"
>
<img
Expand All @@ -472,6 +473,7 @@ function Image({
<img
src={getFaviconFromDomain(new URL(rest.src as string))}
className="w-4 h-4 object-contain object-center m-0"
alt={rest.src}
/>
) : null}
<span className="truncate">{removeUrlProtocol(rest.src)}</span>
Expand Down
4 changes: 2 additions & 2 deletions apps/web-remix/app/components/form/fields/field.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export const FieldContext = React.createContext<{
} | null>(null);

export interface UseFieldContextProps {
validationBehavior?: Partial<ValidationBehaviorOptions>;
validationBehavior?: ValidationBehaviorOptions;
}

export const useFieldContext = (args?: UseFieldContextProps) => {
const context = use(FieldContext);
if (!context)
throw new Error('You tried to use a field without using <Field />');
const fieldProps = useField(context.name, {
validationBehavior: args?.validationBehavior ?? { initial: 'onSubmit' },
validationBehavior: args?.validationBehavior,
});

return useMemo(
Expand Down
11 changes: 8 additions & 3 deletions apps/web-remix/app/components/form/fields/form.field.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useEffect, useMemo, useState } from 'react';
import {
FieldArray as FA,
import type {
FieldArrayApi as FAI,
FieldApi as FApi,
FormApi as FoApi,
FormScope as FS,
ValidationBehaviorConfig,
} from '@rvf/remix';
import {
FieldArray as FA,
useControlField as ucf,
useField as uf,
useFieldArray as ufa,
Expand All @@ -18,10 +22,11 @@ export const useField = uf;
export const useFormScopeOrContext = ufsc;
export const FieldArray = FA;
export const useFieldArray = ufa;
export type ValidationBehaviorOptions = any; // Define your validation behavior options here
export type ValidationBehaviorOptions = ValidationBehaviorConfig; // Define your validation behavior options here
export type FieldArrayApi<T extends any[]> = FAI<T>;
export type FieldApi<T> = FApi<T>;
export type FormApi<T> = FoApi<T>;
export type FormScope<T> = FS<T>;

export const useCurrentFormState = () => {
const {
Expand Down
4 changes: 1 addition & 3 deletions apps/web-remix/app/components/form/fields/text.field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export const TextInputField = ({
validationBehavior,
...props
}: Partial<TextInputFieldProps> & {
validationBehavior?: Partial<ValidationBehaviorOptions>;
ref?: React.RefObject<HTMLInputElement | null> | null;
validationBehavior?: ValidationBehaviorOptions;
}) => {
const { name, getInputProps, error } = useFieldContext({
validationBehavior,
Expand All @@ -27,7 +26,6 @@ export const TextInputField = ({
<TextInput
id={name}
name={name}
// @ts-ignore
ref={ref}
aria-invalid={error ? true : undefined}
aria-describedby={`${name}-error`}
Expand Down
2 changes: 1 addition & 1 deletion apps/web-remix/app/components/form/schema/Schema.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseSize } from '~/components/ui/ui.types';
import type { BaseSize } from '~/components/ui/ui.types';
import { assert } from '~/utils/assert';

import type { JSONSchemaField } from './SchemaParser';
Expand Down
2 changes: 2 additions & 0 deletions apps/web-remix/app/components/pages/auth/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function RegisterPage() {
href="https://buildel.ai/terms-and-conditions"
target="_blank"
className="font-semibold hover:underline"
rel="noreferrer"
>
terms of service
</a>{' '}
Expand All @@ -109,6 +110,7 @@ export function RegisterPage() {
href="https://buildel.ai/privacy-policy"
target="_blank"
className="font-semibold hover:underline"
rel="noreferrer"
>
privacy policy
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ReactNode } from 'react';
import type { ReactNode } from 'react';
import React from 'react';
import type { CellContext } from '@tanstack/react-table';

import { CellText } from '~/components/table/table.components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
NEXT_NODE_COLOR,
PREV_NODE_COLOR,
} from '~/components/pages/knowledgeBase/collectionGraph/collectionGraph.utils';
import { SearchSchema } from '~/components/pages/knowledgeBase/search.schema';
import type { SearchSchema } from '~/components/pages/knowledgeBase/search.schema';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
import { useOrganizationId } from '~/hooks/useOrganizationId';
import { cn } from '~/utils/cn';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import type { LoaderFunctionArgs } from '@remix-run/node';
import { json } from '@remix-run/node';
import invariant from 'tiny-invariant';

import { IPipelinePublicResponse } from '~/api/pipeline/pipeline.contracts';
import type { IPipelinePublicResponse } from '~/api/pipeline/pipeline.contracts';
import { PipelineApi } from '~/api/pipeline/PipelineApi';
import { chatSize } from '~/components/chat/chat.types';
import { UnauthorizedError } from '~/utils/errors';
import type { fetchTyped } from '~/utils/fetch.server';
import { ParsedResponse } from '~/utils/fetch.server';
import type { fetchTyped, ParsedResponse } from '~/utils/fetch.server';

export const interfaceLoader = async (
{ request, params }: LoaderFunctionArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { ValidatedForm, withZod } from '~/utils/form';

import type { ISecretKey } from '../variables.types';
import { loader } from './loader.server';
import type { loader } from './loader.server';

interface EditSecretModalProps {
isOpen: boolean;
Expand Down
3 changes: 2 additions & 1 deletion apps/web-remix/app/hooks/useMergeRefs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RefObject, useCallback } from 'react';
import type { RefObject } from 'react';
import { useCallback } from 'react';

export function useMergedRefs(
...refs: Array<React.Ref<any> | undefined | null>
Expand Down
2 changes: 1 addition & 1 deletion apps/web-remix/app/tests/__tests__/auth/login.handlers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http, HttpResponse } from 'msw';

import { ICurrentUser } from '~/api/CurrentUserApi';
import type { ICurrentUser } from '~/api/CurrentUserApi';

export const handlers = [
http.post('/super-api/users/log_in', () => {
Expand Down

0 comments on commit c84480c

Please sign in to comment.