diff --git a/packages/react-calendar/.eslintrc.json b/packages/react-calendar/.eslintrc.json index 6f2c8ec3..1c5b645c 100644 --- a/packages/react-calendar/.eslintrc.json +++ b/packages/react-calendar/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "wojtekmaj/react-no-automatic-runtime" + "extends": "wojtekmaj/react" } diff --git a/packages/react-calendar/src/Calendar.spec.tsx b/packages/react-calendar/src/Calendar.spec.tsx index b76526d9..9b0a372f 100644 --- a/packages/react-calendar/src/Calendar.spec.tsx +++ b/packages/react-calendar/src/Calendar.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import React, { createRef } from 'react'; +import { createRef } from 'react'; import { act, render } from '@testing-library/react'; import { getMonthStart } from '@wojtekmaj/date-utils'; diff --git a/packages/react-calendar/src/Calendar.tsx b/packages/react-calendar/src/Calendar.tsx index 137cb3bf..f7e7503c 100644 --- a/packages/react-calendar/src/Calendar.tsx +++ b/packages/react-calendar/src/Calendar.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { forwardRef, useCallback, useImperativeHandle, useState } from 'react'; +import { forwardRef, useCallback, useImperativeHandle, useState } from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/react-calendar/src/Calendar/Navigation.spec.tsx b/packages/react-calendar/src/Calendar/Navigation.spec.tsx index 4472e5d8..e53ad405 100644 --- a/packages/react-calendar/src/Calendar/Navigation.spec.tsx +++ b/packages/react-calendar/src/Calendar/Navigation.spec.tsx @@ -1,5 +1,4 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import Navigation from './Navigation.js'; diff --git a/packages/react-calendar/src/Calendar/Navigation.tsx b/packages/react-calendar/src/Calendar/Navigation.tsx index 2d8a726b..f1175730 100644 --- a/packages/react-calendar/src/Calendar/Navigation.tsx +++ b/packages/react-calendar/src/Calendar/Navigation.tsx @@ -1,6 +1,5 @@ 'use client'; -import React from 'react'; import { getUserLocale } from 'get-user-locale'; import { diff --git a/packages/react-calendar/src/CenturyView.spec.tsx b/packages/react-calendar/src/CenturyView.spec.tsx index 79477503..56b5cfbb 100644 --- a/packages/react-calendar/src/CenturyView.spec.tsx +++ b/packages/react-calendar/src/CenturyView.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; import { render } from '@testing-library/react'; import { getDecadeStart, getDecadeEnd } from '@wojtekmaj/date-utils'; diff --git a/packages/react-calendar/src/CenturyView.tsx b/packages/react-calendar/src/CenturyView.tsx index 821b5f1f..150e3d34 100644 --- a/packages/react-calendar/src/CenturyView.tsx +++ b/packages/react-calendar/src/CenturyView.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import Decades from './CenturyView/Decades.js'; diff --git a/packages/react-calendar/src/CenturyView/Decade.spec.tsx b/packages/react-calendar/src/CenturyView/Decade.spec.tsx index bc489b50..d3cb9e7e 100644 --- a/packages/react-calendar/src/CenturyView/Decade.spec.tsx +++ b/packages/react-calendar/src/CenturyView/Decade.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; + import { fireEvent, render } from '@testing-library/react'; import Decade from './Decade.js'; diff --git a/packages/react-calendar/src/CenturyView/Decade.tsx b/packages/react-calendar/src/CenturyView/Decade.tsx index 92ef1d61..10635056 100644 --- a/packages/react-calendar/src/CenturyView/Decade.tsx +++ b/packages/react-calendar/src/CenturyView/Decade.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getDecadeStart, getDecadeEnd, getCenturyStart } from '@wojtekmaj/date-utils'; import Tile from '../Tile.js'; diff --git a/packages/react-calendar/src/CenturyView/Decades.tsx b/packages/react-calendar/src/CenturyView/Decades.tsx index 553cc3d4..65127438 100644 --- a/packages/react-calendar/src/CenturyView/Decades.tsx +++ b/packages/react-calendar/src/CenturyView/Decades.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getDecadeStart } from '@wojtekmaj/date-utils'; import TileGroup from '../TileGroup.js'; diff --git a/packages/react-calendar/src/DecadeView.spec.tsx b/packages/react-calendar/src/DecadeView.spec.tsx index 0d8ddbe6..abe9d293 100644 --- a/packages/react-calendar/src/DecadeView.spec.tsx +++ b/packages/react-calendar/src/DecadeView.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; + import { render } from '@testing-library/react'; import DecadeView from './DecadeView.js'; diff --git a/packages/react-calendar/src/DecadeView.tsx b/packages/react-calendar/src/DecadeView.tsx index e3a67d30..ffdb3cc0 100644 --- a/packages/react-calendar/src/DecadeView.tsx +++ b/packages/react-calendar/src/DecadeView.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import Years from './DecadeView/Years.js'; diff --git a/packages/react-calendar/src/DecadeView/Year.spec.tsx b/packages/react-calendar/src/DecadeView/Year.spec.tsx index bb46e670..133dd563 100644 --- a/packages/react-calendar/src/DecadeView/Year.spec.tsx +++ b/packages/react-calendar/src/DecadeView/Year.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; + import { fireEvent, render } from '@testing-library/react'; import Year from './Year.js'; diff --git a/packages/react-calendar/src/DecadeView/Year.tsx b/packages/react-calendar/src/DecadeView/Year.tsx index e7b9b8ae..8608c27a 100644 --- a/packages/react-calendar/src/DecadeView/Year.tsx +++ b/packages/react-calendar/src/DecadeView/Year.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getYearStart, getYearEnd, getDecadeStart } from '@wojtekmaj/date-utils'; import Tile from '../Tile.js'; diff --git a/packages/react-calendar/src/DecadeView/Years.tsx b/packages/react-calendar/src/DecadeView/Years.tsx index 5be6fec1..8ae4696c 100644 --- a/packages/react-calendar/src/DecadeView/Years.tsx +++ b/packages/react-calendar/src/DecadeView/Years.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getYearStart } from '@wojtekmaj/date-utils'; import TileGroup from '../TileGroup.js'; diff --git a/packages/react-calendar/src/Flex.spec.tsx b/packages/react-calendar/src/Flex.spec.tsx index ea282ff0..d254c74c 100644 --- a/packages/react-calendar/src/Flex.spec.tsx +++ b/packages/react-calendar/src/Flex.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; + import { render } from '@testing-library/react'; import Flex from './Flex.js'; diff --git a/packages/react-calendar/src/Flex.tsx b/packages/react-calendar/src/Flex.tsx index 5578bc66..6e7d3173 100644 --- a/packages/react-calendar/src/Flex.tsx +++ b/packages/react-calendar/src/Flex.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Children, cloneElement } from 'react'; type FlexProps = React.HTMLAttributes & { children: React.ReactElement[]; @@ -35,10 +35,10 @@ export default function Flex({ }} {...otherProps} > - {React.Children.map(children, (child, index) => { + {Children.map(children, (child, index) => { const marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null; - return React.cloneElement(child, { + return cloneElement(child, { ...child.props, style: { flexBasis: toPercent(100 / count), diff --git a/packages/react-calendar/src/MonthView.spec.tsx b/packages/react-calendar/src/MonthView.spec.tsx index fa3e0a21..1280e96d 100644 --- a/packages/react-calendar/src/MonthView.spec.tsx +++ b/packages/react-calendar/src/MonthView.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; + import { render } from '@testing-library/react'; import MonthView from './MonthView.js'; diff --git a/packages/react-calendar/src/MonthView.tsx b/packages/react-calendar/src/MonthView.tsx index ae514623..a903ec47 100644 --- a/packages/react-calendar/src/MonthView.tsx +++ b/packages/react-calendar/src/MonthView.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/react-calendar/src/MonthView/Day.spec.tsx b/packages/react-calendar/src/MonthView/Day.spec.tsx index 69447d50..da9a5a91 100644 --- a/packages/react-calendar/src/MonthView/Day.spec.tsx +++ b/packages/react-calendar/src/MonthView/Day.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; + import { fireEvent, render } from '@testing-library/react'; import Day from './Day.js'; diff --git a/packages/react-calendar/src/MonthView/Day.tsx b/packages/react-calendar/src/MonthView/Day.tsx index 5248b9cc..52962ad8 100644 --- a/packages/react-calendar/src/MonthView/Day.tsx +++ b/packages/react-calendar/src/MonthView/Day.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getDayStart, getDayEnd } from '@wojtekmaj/date-utils'; import Tile from '../Tile.js'; diff --git a/packages/react-calendar/src/MonthView/Days.tsx b/packages/react-calendar/src/MonthView/Days.tsx index 64502b07..a3d05be3 100644 --- a/packages/react-calendar/src/MonthView/Days.tsx +++ b/packages/react-calendar/src/MonthView/Days.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getYear, getMonth, getDaysInMonth, getDayStart } from '@wojtekmaj/date-utils'; import TileGroup from '../TileGroup.js'; diff --git a/packages/react-calendar/src/MonthView/WeekNumber.spec.tsx b/packages/react-calendar/src/MonthView/WeekNumber.spec.tsx index 1dc84152..cc6386e6 100644 --- a/packages/react-calendar/src/MonthView/WeekNumber.spec.tsx +++ b/packages/react-calendar/src/MonthView/WeekNumber.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; import { render } from '@testing-library/react'; import WeekNumber from './WeekNumber.js'; diff --git a/packages/react-calendar/src/MonthView/WeekNumber.tsx b/packages/react-calendar/src/MonthView/WeekNumber.tsx index 1c7eaf43..581d1bd3 100644 --- a/packages/react-calendar/src/MonthView/WeekNumber.tsx +++ b/packages/react-calendar/src/MonthView/WeekNumber.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import type { OnClickWeekNumberFunc } from '../shared/types.js'; const className = 'react-calendar__tile'; diff --git a/packages/react-calendar/src/MonthView/WeekNumbers.spec.tsx b/packages/react-calendar/src/MonthView/WeekNumbers.spec.tsx index 1ed5de2a..d59d1818 100644 --- a/packages/react-calendar/src/MonthView/WeekNumbers.spec.tsx +++ b/packages/react-calendar/src/MonthView/WeekNumbers.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import WeekNumbers from './WeekNumbers.js'; diff --git a/packages/react-calendar/src/MonthView/WeekNumbers.tsx b/packages/react-calendar/src/MonthView/WeekNumbers.tsx index bfc94587..ea5726e5 100644 --- a/packages/react-calendar/src/MonthView/WeekNumbers.tsx +++ b/packages/react-calendar/src/MonthView/WeekNumbers.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getYear, getMonth, getDate, getDaysInMonth } from '@wojtekmaj/date-utils'; import WeekNumber from './WeekNumber.js'; diff --git a/packages/react-calendar/src/MonthView/Weekdays.spec.tsx b/packages/react-calendar/src/MonthView/Weekdays.spec.tsx index 2e2ddaa0..bded3357 100644 --- a/packages/react-calendar/src/MonthView/Weekdays.spec.tsx +++ b/packages/react-calendar/src/MonthView/Weekdays.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; import { render } from '@testing-library/react'; import Weekdays from './Weekdays.js'; diff --git a/packages/react-calendar/src/MonthView/Weekdays.tsx b/packages/react-calendar/src/MonthView/Weekdays.tsx index 9a26af42..f2734ce8 100644 --- a/packages/react-calendar/src/MonthView/Weekdays.tsx +++ b/packages/react-calendar/src/MonthView/Weekdays.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import clsx from 'clsx'; import { getYear, getMonth, getMonthStart } from '@wojtekmaj/date-utils'; diff --git a/packages/react-calendar/src/Tile.spec.tsx b/packages/react-calendar/src/Tile.spec.tsx index 1d44595a..ae3f3c25 100644 --- a/packages/react-calendar/src/Tile.spec.tsx +++ b/packages/react-calendar/src/Tile.spec.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; + import { fireEvent, render } from '@testing-library/react'; import Tile from './Tile.js'; diff --git a/packages/react-calendar/src/Tile.tsx b/packages/react-calendar/src/Tile.tsx index 343e50b5..8b2683ca 100644 --- a/packages/react-calendar/src/Tile.tsx +++ b/packages/react-calendar/src/Tile.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import { useMemo } from 'react'; import clsx from 'clsx'; import type { diff --git a/packages/react-calendar/src/TileGroup.tsx b/packages/react-calendar/src/TileGroup.tsx index 36c14ca1..c89b6f34 100644 --- a/packages/react-calendar/src/TileGroup.tsx +++ b/packages/react-calendar/src/TileGroup.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Flex from './Flex.js'; import { getTileClasses } from './shared/utils.js'; diff --git a/packages/react-calendar/src/YearView.spec.tsx b/packages/react-calendar/src/YearView.spec.tsx index 0e658a18..8a030350 100644 --- a/packages/react-calendar/src/YearView.spec.tsx +++ b/packages/react-calendar/src/YearView.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; -import React from 'react'; import { render } from '@testing-library/react'; import YearView from './YearView.js'; diff --git a/packages/react-calendar/src/YearView.tsx b/packages/react-calendar/src/YearView.tsx index 4e7c388f..fb2d3a64 100644 --- a/packages/react-calendar/src/YearView.tsx +++ b/packages/react-calendar/src/YearView.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Months from './YearView/Months.js'; import { tileGroupProps } from './shared/propTypes.js'; diff --git a/packages/react-calendar/src/YearView/Month.spec.tsx b/packages/react-calendar/src/YearView/Month.spec.tsx index 3444d026..65ef7bfc 100644 --- a/packages/react-calendar/src/YearView/Month.spec.tsx +++ b/packages/react-calendar/src/YearView/Month.spec.tsx @@ -1,5 +1,4 @@ import { describe, expect, it, vi } from 'vitest'; -import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import Month from './Month.js'; diff --git a/packages/react-calendar/src/YearView/Month.tsx b/packages/react-calendar/src/YearView/Month.tsx index f77434a2..b7484494 100644 --- a/packages/react-calendar/src/YearView/Month.tsx +++ b/packages/react-calendar/src/YearView/Month.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getMonthStart, getMonthEnd } from '@wojtekmaj/date-utils'; import Tile from '../Tile.js'; diff --git a/packages/react-calendar/src/YearView/Months.tsx b/packages/react-calendar/src/YearView/Months.tsx index bb7b162b..01e1fde5 100644 --- a/packages/react-calendar/src/YearView/Months.tsx +++ b/packages/react-calendar/src/YearView/Months.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { getMonthStart, getYear } from '@wojtekmaj/date-utils'; import TileGroup from '../TileGroup.js'; diff --git a/packages/react-calendar/tsconfig.json b/packages/react-calendar/tsconfig.json index 22322f16..1d4aa332 100644 --- a/packages/react-calendar/tsconfig.json +++ b/packages/react-calendar/tsconfig.json @@ -3,7 +3,7 @@ "declaration": true, "esModuleInterop": true, "isolatedModules": true, - "jsx": "react", + "jsx": "react-jsx", "module": "nodenext", "noEmit": true, "noUncheckedIndexedAccess": true,