Skip to content

Commit d038c25

Browse files
committed
Linting fixes
1 parent 19e8deb commit d038c25

26 files changed

+240
-198
lines changed

src/components/ui-plus-behavior/input/ActionButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
DialogTitle,
1717
} from '../../ui/dialog.tsx'
1818

19-
export const ActionButton: FC<ActionControls<any>> = props => {
19+
export const ActionButton: FC<ActionControls<unknown>> = props => {
2020
const {
2121
name,
2222
allMessages,

src/components/ui-plus-behavior/input/ExecutionContext.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export type Timeout = ReturnType<typeof setTimeout>
44

55
export type ExecutionContext = {
66
setStatus: (message: MarkdownCode | undefined) => void
7-
log: (message: MarkdownCode, ...optionalParams: any[]) => void
8-
warn: (message: MarkdownCode, ...optionalParams: any[]) => void
9-
error: (message: MarkdownCode, ...optionalParams: any[]) => void
7+
log: (message: MarkdownCode | unknown, ...optionalParams: unknown[]) => void
8+
warn: (message: MarkdownCode | unknown, ...optionalParams: unknown[]) => void
9+
error: (message: MarkdownCode | unknown, ...optionalParams: unknown[]) => void
1010
}
1111

1212
export const basicExecutionContext: ExecutionContext = {

src/components/ui-plus-behavior/input/FieldAndValidationMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MotionDiv } from '../Animations'
77
import { MarkdownBlock } from '../../ui/markdown'
88

99
export const FieldAndValidationMessage: FC<
10-
Pick<InputFieldControls<any>, 'validationPending' | 'validationStatusMessage' | 'clearErrorMessage'> & {
10+
Pick<InputFieldControls<unknown>, 'validationPending' | 'validationStatusMessage' | 'clearErrorMessage'> & {
1111
messages: FieldMessage[]
1212
}
1313
> = props => {

src/components/ui-plus-behavior/input/FieldStatusIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { CircleAlert, CircleCheck, LoaderCircle } from 'lucide-react'
77

88
export const FieldStatusIndicators: FC<
99
Pick<
10-
InputFieldControls<any>,
10+
InputFieldControls<unknown>,
1111
'indicateValidationPending' | 'indicateValidationSuccess' | 'validationPending' | 'isValidated'
1212
> & { messages: FieldMessage[] }
1313
> = props => {

src/components/ui-plus-behavior/input/InputField.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { DateInput } from './DateInput.tsx'
1414
import { DateFieldControls } from './useDateField.ts'
1515

1616
export const InputField: FC<{
17-
controls: Pick<InputFieldControls<any>, 'type' | 'name' | 'expandHorizontally'>
17+
controls: Pick<InputFieldControls<unknown>, 'type' | 'name' | 'expandHorizontally'>
1818
}> = ({ controls }) => {
1919
switch (controls.type) {
2020
case 'text':
@@ -24,13 +24,13 @@ export const InputField: FC<{
2424
case 'boolean':
2525
return <BooleanInput {...(controls as BooleanFieldControls)} />
2626
case 'oneOf':
27-
return <SelectInput {...(controls as OneOfFieldControls<any>)} />
27+
return <SelectInput {...(controls as OneOfFieldControls)} />
2828
case 'label':
29-
return <LabelOutput {...(controls as unknown as LabelControls<any>)} />
29+
return <LabelOutput {...(controls as unknown as LabelControls<unknown>)} />
3030
case 'date':
3131
return <DateInput {...(controls as DateFieldControls)} />
3232
case 'action':
33-
return <ActionButton {...(controls as ActionControls<any>)} />
33+
return <ActionButton {...(controls as ActionControls<unknown>)} />
3434
default:
3535
console.log("Don't know how to edit field type", controls.type)
3636
return (

src/components/ui-plus-behavior/input/InputFieldGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export const InputFieldGroup: FC<InputFieldGroupProps> = ({
6060
padding={false}
6161
>
6262
{row.map(field => (
63-
<InputField key={field.name} controls={{ ...(field as any), expandHorizontally }} />
63+
<InputField key={field.name} controls={{ ...field, expandHorizontally }} />
6464
))}
6565
</WithVisibility>
6666
) : (
67-
<InputField key={row.name} controls={row as InputFieldControls<any>} />
67+
<InputField key={row.name} controls={row as InputFieldControls<unknown>} />
6868
)
6969
)}
7070
</div>

src/components/ui-plus-behavior/input/LabelOutput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { WithVisibility } from './WithVisibility.tsx'
66
import { WithLabelAndDescription } from './WithLabelAndDescription.tsx'
77
import { WithValidation } from './WithValidation.tsx'
88

9-
export const LabelOutput: FC<LabelControls<any>> = props => {
9+
export const LabelOutput: FC<LabelControls<unknown>> = props => {
1010
const { allMessages, classnames, renderedContent } = props
1111

1212
return (

src/components/ui-plus-behavior/input/SelectInput.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
import { MarkdownBlock } from '../../ui/markdown.tsx'
1717
import { Info } from 'lucide-react'
1818

19-
export const SelectInput: FC<OneOfFieldControls<any>> = props => {
20-
const { choices, allMessages, renderValue, value, setValue, enabled, whyDisabled } = props
19+
export const SelectInput: FC<Omit<OneOfFieldControls, 'value' | 'cleanValue' | 'setValue'>> = props => {
20+
const { choices, allMessages, renderValue, setRenderValue, enabled, whyDisabled } = props
2121
const [isOpen, setIsOpen] = useState(false)
2222

2323
const { hasError } = checkMessagesForProblems(allMessages.root)
@@ -29,8 +29,8 @@ export const SelectInput: FC<OneOfFieldControls<any>> = props => {
2929
<MaybeWithTooltip overlay={whyDisabled}>
3030
<Select
3131
disabled={!enabled}
32-
value={renderValue ?? value}
33-
onValueChange={setValue}
32+
value={renderValue}
33+
onValueChange={setRenderValue}
3434
onOpenChange={setIsOpen}
3535
>
3636
<SelectTrigger className="w-full" aria-invalid={hasError}>

src/components/ui-plus-behavior/input/WithDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import classes from './index.module.css'
44
import { MarkdownBlock } from '../../ui/markdown.tsx'
55

66
export const WithDescription: FC<
7-
PropsWithChildren<{ field: Pick<InputFieldControls<any>, 'description'> }>
7+
PropsWithChildren<{ field: Pick<InputFieldControls<unknown>, 'description'> }>
88
> = props => {
99
const { field, children } = props
1010
const { description } = field

src/components/ui-plus-behavior/input/WithLabelAndDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MarkdownBlock } from '../../ui/markdown.tsx'
55
import { Label } from '../../ui/label.tsx'
66

77
export const WithLabelAndDescription: FC<
8-
PropsWithChildren<{ field: Pick<InputFieldControls<any>, 'label' | 'description' | 'compact'> }>
8+
PropsWithChildren<{ field: Pick<InputFieldControls<unknown>, 'label' | 'description' | 'compact'> }>
99
> = props => {
1010
const { field, children } = props
1111
const { label, description, compact } = field

0 commit comments

Comments
 (0)