Skip to content

Commit

Permalink
chore: improved tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Oct 11, 2023
1 parent d697e48 commit 54b70ae
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as React from "react";
import { ExclamationCircleFill } from "react-bootstrap-icons";
import { VariantProps, cva } from "class-variance-authority";
import { type VariantProps, cva } from "class-variance-authority";

type AlertVariantsProps = VariantProps<typeof alertVariants>;

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/breadcrumbs/breadcrumb-item.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AriaBreadcrumbItemProps, useBreadcrumbItem } from "@react-aria/breadcrumbs";
import { type AriaBreadcrumbItemProps, useBreadcrumbItem } from "@react-aria/breadcrumbs";
import * as React from "react";
import { cn } from "mxcn";
import Link from "next/link";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/breadcrumbs/breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { AriaBreadcrumbsProps, useBreadcrumbs } from "@react-aria/breadcrumbs";
import { type AriaBreadcrumbsProps, useBreadcrumbs } from "@react-aria/breadcrumbs";

interface Props extends AriaBreadcrumbsProps {
children: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { AriaButtonProps, useButton } from "@react-aria/button";
import { type AriaButtonProps, useButton } from "@react-aria/button";
import { mergeProps } from "@react-aria/utils";
import { VariantProps, cva } from "class-variance-authority";
import { type VariantProps, cva } from "class-variance-authority";
import { cn } from "mxcn";

export const buttonVariants = cva(
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/context-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
import { cn } from "mxcn";
import { ButtonVariantProps, buttonVariants } from "./button/button";
import { type ButtonVariantProps, buttonVariants } from "./button/button";

export const ContextMenu = ContextMenuPrimitive.Root;
export const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { cn } from "mxcn";
import Link from "next/link";
import { ButtonVariantProps, buttonVariants } from "./button/button";
import { type ButtonVariantProps, buttonVariants } from "./button/button";

export const DropdownMenu = DropdownMenuPrimitive.Root;
export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/error-message.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DOMAttributes } from "@react-types/shared";
import type { DOMAttributes } from "@react-types/shared";
import { ExclamationTriangleFill } from "react-bootstrap-icons";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComboBoxState } from "@react-stately/combobox";
import { type ComboBoxState } from "@react-stately/combobox";
import { Button } from "../../button/button";
import { ChevronDown, X } from "react-bootstrap-icons";
import { cn } from "mxcn";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/fields/checkbox-field.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AriaCheckboxProps, useCheckbox } from "@react-aria/checkbox";
import { type AriaCheckboxProps, useCheckbox } from "@react-aria/checkbox";
import { VisuallyHidden } from "@react-aria/visually-hidden";
import { useToggleState } from "@react-stately/toggle";
import * as React from "react";
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/fields/date-picker-field.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from "react";
import { useDatePickerState } from "@react-stately/datepicker";
import { useDatePicker, AriaDateFieldProps } from "@react-aria/datepicker";
import { useDatePicker, type AriaDateFieldProps } from "@react-aria/datepicker";
import { Calendar2, ExclamationCircle, X } from "react-bootstrap-icons";
import { Button } from "../button/button";
import { useTranslations } from "next-intl";
import { DateValue, parseDate } from "@internationalized/date";
import { type DateValue, parseDate } from "@internationalized/date";
import formatISO9075 from "date-fns/formatISO9075";
import { ModalProvider } from "@react-aria/overlays";
import { cn } from "mxcn";
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/components/fields/radio-group-field.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import * as React from "react";
import { useRadioGroup, useRadio, AriaRadioProps, AriaRadioGroupProps } from "@react-aria/radio";
import {
useRadioGroup,
useRadio,
type AriaRadioProps,
type AriaRadioGroupProps,
} from "@react-aria/radio";
import { useRadioGroupState } from "@react-stately/radio";
import { RadioContext, useRadioFieldContext } from "../../context/radio-field-context";
import { ErrorMessage } from "../error-message";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/fields/switch-field.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AriaSwitchProps, useSwitch } from "@react-aria/switch";
import { type AriaSwitchProps, useSwitch } from "@react-aria/switch";
import { VisuallyHidden } from "@react-aria/visually-hidden";
import { useToggleState } from "@react-stately/toggle";
import * as React from "react";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/fields/text-field.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { AriaTextFieldOptions, TextFieldAria, useTextField } from "@react-aria/textfield";
import { type AriaTextFieldOptions, type TextFieldAria, useTextField } from "@react-aria/textfield";
import { cn } from "mxcn";
import { Input } from "../inputs/input";
import { Textarea } from "../inputs/textarea";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { useCalendarState } from "@react-stately/calendar";
import { CalendarProps, useCalendar } from "@react-aria/calendar";
import { type CalendarProps, useCalendar } from "@react-aria/calendar";
import { type DateValue, createCalendar } from "@internationalized/date";
import { CalendarGrid } from "./calendar-grid";
import { Button } from "../../../button/button";
Expand Down
8 changes: 6 additions & 2 deletions packages/ui/src/components/inputs/date-picker/date-field.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as React from "react";
import { useLocale } from "@react-aria/i18n";
import { useDateFieldState, type DateSegment, DateFieldState } from "@react-stately/datepicker";
import { AriaDatePickerProps, useDateField, useDateSegment } from "@react-aria/datepicker";
import {
useDateFieldState,
type DateSegment,
type DateFieldState,
} from "@react-stately/datepicker";
import { type AriaDatePickerProps, useDateField, useDateSegment } from "@react-aria/datepicker";
import { type DateValue, createCalendar } from "@internationalized/date";
import { cn } from "mxcn";

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/multi-form/multi-form-step.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormikProps, FormikValues, useFormikContext } from "formik";
import { type FormikProps, type FormikValues, useFormikContext } from "formik";

export interface MultiFormStepItem<FormValues extends FormikValues> {
title: string;
Expand Down
11 changes: 9 additions & 2 deletions packages/ui/src/components/multi-form/multi-form.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import * as React from "react";
import { FormikHelpers, Form, Formik, FormikConfig, FormikProps, FormikValues } from "formik";
import {
type FormikHelpers,
Form,
Formik,
type FormikConfig,
type FormikProps,
type FormikValues,
} from "formik";
import { cn } from "mxcn";
import { Button } from "../button/button";
import { ArrowLeft, ArrowRight } from "react-bootstrap-icons";
import { MultiFormStep, MultiFormStepItem } from "./multi-form-step";
import { MultiFormStep, type MultiFormStepItem } from "./multi-form-step";

interface Props<FormValues extends FormikValues>
extends Omit<FormikConfig<FormValues>, "children"> {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/overlays/popover.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { FocusScope } from "@react-aria/focus";
import { AriaDialogProps, useDialog } from "@react-aria/dialog";
import { type AriaDialogProps, useDialog } from "@react-aria/dialog";
import {
OverlayContainer,
useOverlayPosition,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/hooks/select/useMultiSelectListState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from "react";
import { ListState, useListState } from "@react-stately/list";
import { type ListState, useListState } from "@react-stately/list";
import type { CollectionBase, MultipleSelection, Node } from "@react-types/shared";

export type MultiSelectListProps<T> = CollectionBase<T> & MultipleSelection;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/hooks/select/useMultiSelectState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { MenuTriggerState, useMenuTriggerState } from "@react-stately/menu";
import { MultiSelectListState, useMultiSelectListState } from "./useMultiSelectListState";
import { type MenuTriggerState, useMenuTriggerState } from "@react-stately/menu";
import { type MultiSelectListState, useMultiSelectListState } from "./useMultiSelectListState";

import type { OverlayTriggerProps } from "@react-types/overlays";
import type {
Expand Down
17 changes: 6 additions & 11 deletions packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"target": "ESNext",
"module": "CommonJS",
"moduleResolution": "node",
"declaration": true,
"skipLibCheck": true,
"importHelpers": true,
"esModuleInterop": true,
"jsx": "react-jsx"
},
"exclude": ["dist", "node_modules"]
"moduleResolution": "Bundler",
"module": "ESNext",
"noEmit": true,
"jsx": "react-jsx",
"lib": ["ES2022", "DOM", "DOM.Iterable"]
}
}

0 comments on commit 54b70ae

Please sign in to comment.