diff --git a/src/hooks/UseArray/Bookshelf/Bookshelf.tsx b/src/hooks/UseArray/Bookshelf/Bookshelf.tsx index a986664a..f42d1475 100644 --- a/src/hooks/UseArray/Bookshelf/Bookshelf.tsx +++ b/src/hooks/UseArray/Bookshelf/Bookshelf.tsx @@ -1,4 +1,5 @@ -import React, { Fragment } from 'react' +import type React from 'react' +import { Fragment } from 'react' import { Button } from '../../../storybook-common/components' import useArray from '../useArray' import { BOOKS, UNUSED_BOOKS } from './constants' diff --git a/src/hooks/UseArray/Bookshelf/UseArray.Bookshelf.stories.tsx b/src/hooks/UseArray/Bookshelf/UseArray.Bookshelf.stories.tsx index 1eade021..40344673 100644 --- a/src/hooks/UseArray/Bookshelf/UseArray.Bookshelf.stories.tsx +++ b/src/hooks/UseArray/Bookshelf/UseArray.Bookshelf.stories.tsx @@ -1,4 +1,4 @@ -import { Meta, StoryObj } from '@storybook/react' +import type { Meta, StoryObj } from '@storybook/react' import Bookshelf from './Bookshelf' import BOOKSHELF_CODE from './Bookshelf.tsx?raw' diff --git a/src/hooks/UseArray/Burger/Burger.tsx b/src/hooks/UseArray/Burger/Burger.tsx index 4455449a..fa369c90 100644 --- a/src/hooks/UseArray/Burger/Burger.tsx +++ b/src/hooks/UseArray/Burger/Burger.tsx @@ -1,4 +1,5 @@ -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import '../../../index.css' import { Button, Select } from '../../../storybook-common/components' import useArray from '../useArray' @@ -10,7 +11,7 @@ import { INGREDIENT_OPTIONS, INGREDIENT_WIDTH, } from './constants' -import { Ingredient, IngredientGroup } from './types' +import type { Ingredient, IngredientGroup } from './types' const Burger: React.FC = () => { const [ diff --git a/src/hooks/UseArray/Burger/UseArray.Burger.stories.tsx b/src/hooks/UseArray/Burger/UseArray.Burger.stories.tsx index b5896a54..c449d3c7 100644 --- a/src/hooks/UseArray/Burger/UseArray.Burger.stories.tsx +++ b/src/hooks/UseArray/Burger/UseArray.Burger.stories.tsx @@ -1,4 +1,4 @@ -import { Meta, StoryObj } from '@storybook/react' +import type { Meta, StoryObj } from '@storybook/react' import Burger from './Burger' import BURGER_CODE from './Burger.tsx?raw' diff --git a/src/hooks/UseArray/Burger/components/BottomBun.tsx b/src/hooks/UseArray/Burger/components/BottomBun.tsx index f541d7f6..604cc2a8 100644 --- a/src/hooks/UseArray/Burger/components/BottomBun.tsx +++ b/src/hooks/UseArray/Burger/components/BottomBun.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const BottomBun: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Cheese.tsx b/src/hooks/UseArray/Burger/components/Cheese.tsx index 08b7051d..0e78dc62 100644 --- a/src/hooks/UseArray/Burger/components/Cheese.tsx +++ b/src/hooks/UseArray/Burger/components/Cheese.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Cheese: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Ketchup.tsx b/src/hooks/UseArray/Burger/components/Ketchup.tsx index 78463860..f10b2878 100644 --- a/src/hooks/UseArray/Burger/components/Ketchup.tsx +++ b/src/hooks/UseArray/Burger/components/Ketchup.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Ketchup: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Lettuce.tsx b/src/hooks/UseArray/Burger/components/Lettuce.tsx index 928f17d0..d3ff2429 100644 --- a/src/hooks/UseArray/Burger/components/Lettuce.tsx +++ b/src/hooks/UseArray/Burger/components/Lettuce.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Lettuce: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Mayo.tsx b/src/hooks/UseArray/Burger/components/Mayo.tsx index 3cfe12cd..e6ac8609 100644 --- a/src/hooks/UseArray/Burger/components/Mayo.tsx +++ b/src/hooks/UseArray/Burger/components/Mayo.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Mayo: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Mustard.tsx b/src/hooks/UseArray/Burger/components/Mustard.tsx index 72254a7c..1f5affbc 100644 --- a/src/hooks/UseArray/Burger/components/Mustard.tsx +++ b/src/hooks/UseArray/Burger/components/Mustard.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Mustard: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Patty.tsx b/src/hooks/UseArray/Burger/components/Patty.tsx index 6ea0a54b..443517a9 100644 --- a/src/hooks/UseArray/Burger/components/Patty.tsx +++ b/src/hooks/UseArray/Burger/components/Patty.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Patty: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/Tomato.tsx b/src/hooks/UseArray/Burger/components/Tomato.tsx index d162cf50..e275c825 100644 --- a/src/hooks/UseArray/Burger/components/Tomato.tsx +++ b/src/hooks/UseArray/Burger/components/Tomato.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const Tomato: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/components/TopBun.tsx b/src/hooks/UseArray/Burger/components/TopBun.tsx index 62a49065..3ef4b776 100644 --- a/src/hooks/UseArray/Burger/components/TopBun.tsx +++ b/src/hooks/UseArray/Burger/components/TopBun.tsx @@ -1,4 +1,5 @@ -import React, { SVGProps } from 'react' +import type React from 'react' +import type { SVGProps } from 'react' const TopBun: React.FC> = props => ( diff --git a/src/hooks/UseArray/Burger/constants.ts b/src/hooks/UseArray/Burger/constants.ts index d5e1f04d..9ef3753f 100644 --- a/src/hooks/UseArray/Burger/constants.ts +++ b/src/hooks/UseArray/Burger/constants.ts @@ -9,7 +9,7 @@ import { Tomato, TopBun, } from './components' -import { Ingredient, IngredientGroup } from './types' +import type { Ingredient, IngredientGroup } from './types' export const INGREDIENT_WIDTH = '20rem' diff --git a/src/hooks/UseArray/Burger/types.ts b/src/hooks/UseArray/Burger/types.ts index 0303c889..908a9ce0 100644 --- a/src/hooks/UseArray/Burger/types.ts +++ b/src/hooks/UseArray/Burger/types.ts @@ -1,4 +1,4 @@ -import { INGREDIENTS, INGREDIENT_GROUPS } from './constants' +import type { INGREDIENTS, INGREDIENT_GROUPS } from './constants' export type Ingredient = keyof typeof INGREDIENTS diff --git a/src/hooks/UseDeepCompareEffect/useDeepCompareEffect.ts b/src/hooks/UseDeepCompareEffect/useDeepCompareEffect.ts index 143a2791..27d1f2ea 100644 --- a/src/hooks/UseDeepCompareEffect/useDeepCompareEffect.ts +++ b/src/hooks/UseDeepCompareEffect/useDeepCompareEffect.ts @@ -1,5 +1,6 @@ import isEqual from 'lodash.isequal' -import React, { useEffect, useMemo, useRef } from 'react' +import type React from 'react' +import { useEffect, useMemo, useRef } from 'react' const useDeepCompareMemoize = (value: T) => { const ref = useRef(value) diff --git a/src/hooks/UseFlag/Form/Form.tsx b/src/hooks/UseFlag/Form/Form.tsx index 983bcc4f..51160ec1 100644 --- a/src/hooks/UseFlag/Form/Form.tsx +++ b/src/hooks/UseFlag/Form/Form.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import { Button } from '../../../storybook-common/components' import useFlag from '../useFlag' diff --git a/src/hooks/UseFlag/Form/UseFlag.Form.stories.tsx b/src/hooks/UseFlag/Form/UseFlag.Form.stories.tsx index 23c9f180..c2c45f8e 100644 --- a/src/hooks/UseFlag/Form/UseFlag.Form.stories.tsx +++ b/src/hooks/UseFlag/Form/UseFlag.Form.stories.tsx @@ -1,4 +1,4 @@ -import { Meta, StoryObj } from '@storybook/react' +import type { Meta, StoryObj } from '@storybook/react' import Form from './Form' import FORM_CODE from './Form.tsx?raw' diff --git a/src/hooks/UseFlag/Modal/Modal.tsx b/src/hooks/UseFlag/Modal/Modal.tsx index 3b646e8e..bc544ef6 100644 --- a/src/hooks/UseFlag/Modal/Modal.tsx +++ b/src/hooks/UseFlag/Modal/Modal.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import '../../../index.css' import { Button, Modal as Modal_ } from '../../../storybook-common/components' import useFlag from '../useFlag' diff --git a/src/hooks/UseFlexCorners/Apps/Apps.tsx b/src/hooks/UseFlexCorners/Apps/Apps.tsx index c877aaf2..c95e20ee 100644 --- a/src/hooks/UseFlexCorners/Apps/Apps.tsx +++ b/src/hooks/UseFlexCorners/Apps/Apps.tsx @@ -1,4 +1,5 @@ -import React, { useMemo } from 'react' +import type React from 'react' +import { useMemo } from 'react' import useFlexCorners from '../useFlexCorners' interface Props { diff --git a/src/hooks/UseForm/JobApplication/JobApplication.tsx b/src/hooks/UseForm/JobApplication/JobApplication.tsx index 0e05bd3f..be59e42b 100644 --- a/src/hooks/UseForm/JobApplication/JobApplication.tsx +++ b/src/hooks/UseForm/JobApplication/JobApplication.tsx @@ -1,7 +1,8 @@ -import React from 'react' +import type React from 'react' import { Select } from '../../../storybook-common/components' import Button from '../../../storybook-common/components/Button' -import useForm, { Errors } from '../useForm' +import type { Errors } from '../useForm' +import useForm from '../useForm' import { buildOverriddenRegister } from '../useForm/utils' enum Title { diff --git a/src/hooks/UseForm/JobApplication/UseForm.JobApplication.stories.tsx b/src/hooks/UseForm/JobApplication/UseForm.JobApplication.stories.tsx index 9dd302db..d53dbfa1 100644 --- a/src/hooks/UseForm/JobApplication/UseForm.JobApplication.stories.tsx +++ b/src/hooks/UseForm/JobApplication/UseForm.JobApplication.stories.tsx @@ -1,6 +1,7 @@ -import { Meta, StoryObj } from '@storybook/react' -import { Errors } from '../useForm' -import JobApplication, { ApplicationFormData } from './JobApplication' +import type { Meta, StoryObj } from '@storybook/react' +import type { Errors } from '../useForm' +import type { ApplicationFormData } from './JobApplication' +import JobApplication from './JobApplication' import JOB_APPLICATION_CODE from './JobApplication.tsx?raw' type FormMeta = Meta diff --git a/src/hooks/UseForm/Spreadsheet/Spreadsheet.tsx b/src/hooks/UseForm/Spreadsheet/Spreadsheet.tsx index 538dd60c..f0c9b02d 100644 --- a/src/hooks/UseForm/Spreadsheet/Spreadsheet.tsx +++ b/src/hooks/UseForm/Spreadsheet/Spreadsheet.tsx @@ -1,8 +1,10 @@ -import React, { Fragment } from 'react' +import type React from 'react' +import { Fragment } from 'react' import { Select } from '../../../storybook-common/components' import Button from '../../../storybook-common/components/Button' import useTally from '../../UseTally/useTally' -import useForm, { Errors, FormData } from '../useForm' +import type { Errors, FormData } from '../useForm' +import useForm from '../useForm' import { buildOverriddenRegister } from '../useForm/utils' import { SIZE_OPTIONS } from './constants' import { formatField } from './formatters' diff --git a/src/hooks/UseForm/Spreadsheet/UseForm.Spreadsheet.stories.tsx b/src/hooks/UseForm/Spreadsheet/UseForm.Spreadsheet.stories.tsx index 069662cb..e28e39df 100644 --- a/src/hooks/UseForm/Spreadsheet/UseForm.Spreadsheet.stories.tsx +++ b/src/hooks/UseForm/Spreadsheet/UseForm.Spreadsheet.stories.tsx @@ -1,6 +1,7 @@ -import { Meta, StoryObj } from '@storybook/react' -import { Errors, FormData } from '../useForm' -import Spreadsheet, { SpreadsheetFormData } from './Spreadsheet' +import type { Meta, StoryObj } from '@storybook/react' +import type { Errors, FormData } from '../useForm' +import type { SpreadsheetFormData } from './Spreadsheet' +import Spreadsheet from './Spreadsheet' import SPREADSHEET_CODE from './Spreadsheet.tsx?raw' type FormMeta = Meta diff --git a/src/hooks/UseForm/useForm/types/internal.ts b/src/hooks/UseForm/useForm/types/internal.ts index 8c8e3324..f2d23173 100644 --- a/src/hooks/UseForm/useForm/types/internal.ts +++ b/src/hooks/UseForm/useForm/types/internal.ts @@ -1,4 +1,4 @@ -import { FieldElement, FieldsData } from './public' +import type { FieldElement, FieldsData } from './public' export type ObjectKey = string | number | symbol diff --git a/src/hooks/UseForm/useForm/types/public.ts b/src/hooks/UseForm/useForm/types/public.ts index e36712a2..71a86c54 100644 --- a/src/hooks/UseForm/useForm/types/public.ts +++ b/src/hooks/UseForm/useForm/types/public.ts @@ -1,12 +1,12 @@ -import React from 'react' -import { +import type React from 'react' +import type { Coordinates, CoordinatesOfLength, CoordinatesOrNever, GraphData, IGraph, } from '../../../UseGraph/Graph' -import { ObjectKey, PartialDataKeys } from './internal' +import type { ObjectKey, PartialDataKeys } from './internal' /** * The type of elements that can be registered with `useForm` - inputs, selects, and textareas diff --git a/src/hooks/UseForm/useForm/useForm.ts b/src/hooks/UseForm/useForm/useForm.ts index c9178bcf..e61f5a9f 100644 --- a/src/hooks/UseForm/useForm/useForm.ts +++ b/src/hooks/UseForm/useForm/useForm.ts @@ -1,14 +1,14 @@ import React, { useCallback, useMemo, useRef } from 'react' import { getObjectWithoutKey } from '../../../common/utils' -import { +import type { Coordinates, CoordinatesOfLength, CoordinatesOrNever, - Graph, IGraph, } from '../../UseGraph/Graph' +import { Graph } from '../../UseGraph/Graph' import useGraph from '../../UseGraph/useGraph' -import { +import type { Changed, Deregister, DeregisterAtCoordinates, diff --git a/src/hooks/UseForm/useForm/utils/internal.ts b/src/hooks/UseForm/useForm/utils/internal.ts index c47db33e..2e8866de 100644 --- a/src/hooks/UseForm/useForm/utils/internal.ts +++ b/src/hooks/UseForm/useForm/utils/internal.ts @@ -1,6 +1,6 @@ -import React from 'react' -import { CoordinatesOrNever, Tuple } from '../../../UseGraph/Graph' -import { +import type React from 'react' +import type { CoordinatesOrNever, Tuple } from '../../../UseGraph/Graph' +import type { FieldData, FieldElement, Fields, @@ -8,6 +8,8 @@ import { FormData, PartialDataKeys, RegisterResult, +} from '../types' +import { isCheckboxInput, isDateInput, isFileInput, diff --git a/src/hooks/UseForm/useForm/utils/public.ts b/src/hooks/UseForm/useForm/utils/public.ts index 3c4be34b..7cc7cc5e 100644 --- a/src/hooks/UseForm/useForm/utils/public.ts +++ b/src/hooks/UseForm/useForm/utils/public.ts @@ -1,4 +1,4 @@ -import { FieldElement, FieldsData, Register, RegisterOptions } from '../types' +import type { FieldElement, FieldsData, Register, RegisterOptions } from '../types' import { overrideRegisterResultPropNames } from './internal' export /** diff --git a/src/hooks/UseGraph/Graph.ts b/src/hooks/UseGraph/Graph.ts index bfba2604..b7b9a2ee 100644 --- a/src/hooks/UseGraph/Graph.ts +++ b/src/hooks/UseGraph/Graph.ts @@ -1,4 +1,4 @@ -import { Length, SafeSubtract } from '../../common/types/arithmetic' +import type { Length, SafeSubtract } from '../../common/types/arithmetic' import { getObjectWithoutKey } from '../../common/utils' // #region tuple types diff --git a/src/hooks/UseGraph/useGraph.ts b/src/hooks/UseGraph/useGraph.ts index a44ea330..d79aab98 100644 --- a/src/hooks/UseGraph/useGraph.ts +++ b/src/hooks/UseGraph/useGraph.ts @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react' -import { +import type { Clear, Coordinates, CoordinatesOfLength, @@ -7,7 +7,6 @@ import { ForEachVertex, GetAtCoordinates, GetVertex, - Graph, GraphData, GraphDataAtCoordinates, Map, @@ -19,6 +18,7 @@ import { SetAllVertices, SomeVertex, } from './Graph' +import { Graph } from './Graph' /** * The type of the `set` function for `useGraph` diff --git a/src/hooks/UseMutationObserver/Attributes/Attributes.tsx b/src/hooks/UseMutationObserver/Attributes/Attributes.tsx index 4f404b78..8c098cb0 100644 --- a/src/hooks/UseMutationObserver/Attributes/Attributes.tsx +++ b/src/hooks/UseMutationObserver/Attributes/Attributes.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from 'react' +import type React from 'react' +import { useEffect } from 'react' import useMutationObserver from '../useMutationObserver' interface Props { @@ -12,7 +13,7 @@ const Attributes: React.FC = ({ attributeMutation, attribute }) => { subtree: true, }) useEffect(() => { - const currentAttribute = document.getElementById('example-div')?.dataset.attribute + const currentAttribute = document.getElementById('example-div')?.dataset['attribute'] if (records && currentAttribute !== undefined) { attributeMutation( `Observed mutation with record attributeName ${records?.[0].attributeName}, div data ${ diff --git a/src/hooks/UseResizeObserver/ContainerQuery/ContainerQuery.tsx b/src/hooks/UseResizeObserver/ContainerQuery/ContainerQuery.tsx index f83a6c26..48325bee 100644 --- a/src/hooks/UseResizeObserver/ContainerQuery/ContainerQuery.tsx +++ b/src/hooks/UseResizeObserver/ContainerQuery/ContainerQuery.tsx @@ -1,4 +1,5 @@ -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import useResizeObserver from '../useResizeObserver' const ContainerQuery: React.FC = () => { diff --git a/src/hooks/UseResizeObserver/TextArea/TextArea.tsx b/src/hooks/UseResizeObserver/TextArea/TextArea.tsx index ca262af0..a4f4fa9e 100644 --- a/src/hooks/UseResizeObserver/TextArea/TextArea.tsx +++ b/src/hooks/UseResizeObserver/TextArea/TextArea.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from 'react' +import type React from 'react' +import { useEffect, useState } from 'react' import useResizeObserver from '../useResizeObserver' interface Props { diff --git a/src/hooks/UseTally/SocialMedia/SocialMedia.tsx b/src/hooks/UseTally/SocialMedia/SocialMedia.tsx index a8b3d60c..8e824c08 100644 --- a/src/hooks/UseTally/SocialMedia/SocialMedia.tsx +++ b/src/hooks/UseTally/SocialMedia/SocialMedia.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import { Button } from '../../../storybook-common/components' import useTally from '../useTally' import PFP from './assets/pfp.jpeg' diff --git a/src/hooks/UseTally/useTally.ts b/src/hooks/UseTally/useTally.ts index 0464546a..c6ef1c0b 100644 --- a/src/hooks/UseTally/useTally.ts +++ b/src/hooks/UseTally/useTally.ts @@ -1,4 +1,5 @@ -import React, { useCallback, useState } from 'react' +import type React from 'react' +import { useCallback, useState } from 'react' /** * Arguments to the `useTally` hook diff --git a/src/hooks/UseThrottleFunction/API/API.tsx b/src/hooks/UseThrottleFunction/API/API.tsx index 11e3244c..7a10c9dc 100644 --- a/src/hooks/UseThrottleFunction/API/API.tsx +++ b/src/hooks/UseThrottleFunction/API/API.tsx @@ -1,4 +1,5 @@ -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import useThrottleFunction from '../useThrottleFunction' import COUNTRIES from './assets/countries.json' diff --git a/src/hooks/UseThrottleValue/Counter/Counter.tsx b/src/hooks/UseThrottleValue/Counter/Counter.tsx index 897b5a8d..3c8c0f66 100644 --- a/src/hooks/UseThrottleValue/Counter/Counter.tsx +++ b/src/hooks/UseThrottleValue/Counter/Counter.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from 'react' +import type React from 'react' +import { useEffect } from 'react' import useTally from '../../UseTally/useTally' import useThrottleValue from '../useThrottleValue' diff --git a/src/hooks/UseThrottleValue/Search/Search.tsx b/src/hooks/UseThrottleValue/Search/Search.tsx index 83ba94c2..bdfbb7df 100644 --- a/src/hooks/UseThrottleValue/Search/Search.tsx +++ b/src/hooks/UseThrottleValue/Search/Search.tsx @@ -1,4 +1,5 @@ -import React, { useMemo } from 'react' +import type React from 'react' +import { useMemo } from 'react' import BOOK_NAMES from '../../../storybook-common/assets/book-names.json' import useThrottleValue from '../useThrottleValue' diff --git a/src/hooks/UseWindowListener/MouseMove/MouseMove.tsx b/src/hooks/UseWindowListener/MouseMove/MouseMove.tsx index a556446f..db247372 100644 --- a/src/hooks/UseWindowListener/MouseMove/MouseMove.tsx +++ b/src/hooks/UseWindowListener/MouseMove/MouseMove.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import useWindowListener from '../useWindowListener' interface Props { diff --git a/src/hooks/UseWindowListener/Resize/Resize.tsx b/src/hooks/UseWindowListener/Resize/Resize.tsx index a4b5ae71..3de422b9 100644 --- a/src/hooks/UseWindowListener/Resize/Resize.tsx +++ b/src/hooks/UseWindowListener/Resize/Resize.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import useWindowListener from '../useWindowListener' interface Props { diff --git a/src/index.ts b/src/index.ts index cb5e04fb..04877619 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,11 +10,8 @@ import useFlexCorners, { type UseFlexCornersReturn, } from './hooks/UseFlexCorners/useFlexCorners' import useForm from './hooks/UseForm/useForm' -import useGraph, { - UseGraph, - UseGraphReturn, - UseGraphReturnFunctions, -} from './hooks/UseGraph/useGraph' +import type { UseGraph, UseGraphReturn, UseGraphReturnFunctions } from './hooks/UseGraph/useGraph' +import useGraph from './hooks/UseGraph/useGraph' import useMatchMedia, { type UseMatchMedia } from './hooks/UseMatchMedia/useMatchMedia' import useMutationObserver, { type UseMutationObserver, diff --git a/src/storybook-common/components/Button.tsx b/src/storybook-common/components/Button.tsx index 5ae69e18..2915641e 100644 --- a/src/storybook-common/components/Button.tsx +++ b/src/storybook-common/components/Button.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps } from 'react' +import type React from 'react' +import type { ComponentProps } from 'react' interface Props extends ComponentProps<'button'> { variant?: 'fill' | 'outline' | 'text' diff --git a/src/storybook-common/components/Modal.tsx b/src/storybook-common/components/Modal.tsx index a021904a..11ea2795 100644 --- a/src/storybook-common/components/Modal.tsx +++ b/src/storybook-common/components/Modal.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import type React from 'react' import ReactDOM from 'react-dom' import Button from './Button' diff --git a/src/storybook-common/components/Select.tsx b/src/storybook-common/components/Select.tsx index 274df38c..dbb05519 100644 --- a/src/storybook-common/components/Select.tsx +++ b/src/storybook-common/components/Select.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps } from 'react' +import type React from 'react' +import type { ComponentProps } from 'react' type OptionValue = React.OptionHTMLAttributes['value'] diff --git a/tsconfig.json b/tsconfig.json index 158323bd..b4fa6225 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,32 @@ { + // This is based on https://bun.sh/docs/typescript#suggested-compileroptions + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Bun", + "docs": "https://bun.sh/docs/typescript", + "compilerOptions": { + // Enable latest features + "lib": ["ESNext", "DOM"], "target": "ESNext", - "useDefineForClassFields": true, - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "allowJs": false, - "skipLibCheck": true, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, "module": "ESNext", - "moduleResolution": "Node", - "resolveJsonModule": true, - "isolatedModules": true, + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, "noEmit": true, - "jsx": "react-jsx" - }, - "references": [{ "path": "./tsconfig.bun.json" }] + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + + // Some stricter flags + "noUnusedLocals": true, + "noUnusedParameters": true, + "noPropertyAccessFromIndexSignature": true + } }