diff --git a/.eslintrc.js b/.eslintrc.js index 23bcf0c2f56..ee804849d99 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -118,7 +118,7 @@ module.exports = { 'no-unused-vars': [ERROR, {args: 'none', vars: 'all', varsIgnorePattern: '[rR]eact'}], 'space-in-parens': [ERROR, 'never'], 'space-unary-ops': [ERROR, {words: true, nonwords: false}], - 'spaced-comment': [ERROR, 'always', {exceptions: ['*'], markers: ['/']}], + 'spaced-comment': [ERROR, 'always', {exceptions: ['*', '#__PURE__'], markers: ['/']}], 'max-depth': [WARN, 4], 'radix': [ERROR, 'always'], 'react/jsx-uses-react': WARN, diff --git a/packages/react-aria-components/src/Breadcrumbs.tsx b/packages/react-aria-components/src/Breadcrumbs.tsx index 5fe3209c668..18792fabdf4 100644 --- a/packages/react-aria-components/src/Breadcrumbs.tsx +++ b/packages/react-aria-components/src/Breadcrumbs.tsx @@ -56,7 +56,7 @@ function Breadcrumbs(props: BreadcrumbsProps, ref: Forwarde /** * Breadcrumbs display a heirarchy of links to the current page or resource in an application. */ -const _Breadcrumbs = (forwardRef as forwardRefType)(Breadcrumbs); +const _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs); export {_Breadcrumbs as Breadcrumbs}; interface BreadcrumbItemProps { diff --git a/packages/react-aria-components/src/Calendar.tsx b/packages/react-aria-components/src/Calendar.tsx index 5d270915d3e..38d39d476f0 100644 --- a/packages/react-aria-components/src/Calendar.tsx +++ b/packages/react-aria-components/src/Calendar.tsx @@ -103,7 +103,7 @@ function Calendar(props: CalendarProps, ref: ForwardedRe /** * A calendar displays one or more date grids and allows users to select a single date. */ -const _Calendar = (forwardRef as forwardRefType)(Calendar); +const _Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(Calendar); export {_Calendar as Calendar}; function RangeCalendar(props: RangeCalendarProps, ref: ForwardedRef) { @@ -172,7 +172,7 @@ function RangeCalendar(props: RangeCalendarProps, ref: F /** * A range calendar displays one or more date grids and allows users to select a contiguous range of dates. */ -const _RangeCalendar = (forwardRef as forwardRefType)(RangeCalendar); +const _RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(RangeCalendar); export {_RangeCalendar as RangeCalendar}; export interface CalendarCellRenderProps { diff --git a/packages/react-aria-components/src/ComboBox.tsx b/packages/react-aria-components/src/ComboBox.tsx index f7263db8140..cc79ef9225a 100644 --- a/packages/react-aria-components/src/ComboBox.tsx +++ b/packages/react-aria-components/src/ComboBox.tsx @@ -125,5 +125,5 @@ function ComboBox(props: ComboBoxProps, ref: ForwardedRef(props: DateFieldProps, ref: Forwarded * A date field allows users to enter and edit date and time values using a keyboard. * Each part of a date value is displayed in an individually editable segment. */ -const _DateField = (forwardRef as forwardRefType)(DateField); +const _DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(DateField); export {_DateField as DateField}; function TimeField(props: TimeFieldProps, ref: ForwardedRef) { @@ -116,7 +116,7 @@ function TimeField(props: TimeFieldProps, ref: Forwarded * A time field allows users to enter and edit time values using a keyboard. * Each part of a time value is displayed in an individually editable segment. */ -const _TimeField = (forwardRef as forwardRefType)(TimeField); +const _TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(TimeField); export {_TimeField as TimeField}; const InternalDateInputContext = createContext(null); diff --git a/packages/react-aria-components/src/DatePicker.tsx b/packages/react-aria-components/src/DatePicker.tsx index 9e82e05d0a0..50a9154a3d6 100644 --- a/packages/react-aria-components/src/DatePicker.tsx +++ b/packages/react-aria-components/src/DatePicker.tsx @@ -88,7 +88,7 @@ function DatePicker(props: DatePickerProps, ref: Forward /** * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value. */ -const _DatePicker = (forwardRef as forwardRefType)(DatePicker); +const _DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(DatePicker); export {_DatePicker as DatePicker}; function DateRangePicker(props: DateRangePickerProps, ref: ForwardedRef) { @@ -174,5 +174,5 @@ function DateRangePicker(props: DateRangePickerProps, re * A date range picker combines two DateFields and a RangeCalendar popover to allow * users to enter or select a date and time range. */ -const _DateRangePicker = (forwardRef as forwardRefType)(DateRangePicker); +const _DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(DateRangePicker); export {_DateRangePicker as DateRangePicker}; diff --git a/packages/react-aria-components/src/GridList.tsx b/packages/react-aria-components/src/GridList.tsx index fff05641dce..1d23c568925 100644 --- a/packages/react-aria-components/src/GridList.tsx +++ b/packages/react-aria-components/src/GridList.tsx @@ -222,7 +222,7 @@ function GridList(props: GridListProps, ref: ForwardedRef { diff --git a/packages/react-aria-components/src/Menu.tsx b/packages/react-aria-components/src/Menu.tsx index 3821adbbf6b..606fe7946dc 100644 --- a/packages/react-aria-components/src/Menu.tsx +++ b/packages/react-aria-components/src/Menu.tsx @@ -119,7 +119,7 @@ function MenuInner({props, collection, menuRef: ref}: MenuInne /** * A menu displays a list of actions or options that a user can choose. */ -const _Menu = (forwardRef as forwardRefType)(Menu); +const _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu); export {_Menu as Menu}; interface MenuSectionProps extends StyleProps { diff --git a/packages/react-aria-components/src/Select.tsx b/packages/react-aria-components/src/Select.tsx index 7de5621f1c6..571c98ad6d9 100644 --- a/packages/react-aria-components/src/Select.tsx +++ b/packages/react-aria-components/src/Select.tsx @@ -115,7 +115,7 @@ function Select(props: SelectProps, ref: ForwardedRef { @@ -176,5 +176,5 @@ function SelectValue(props: SelectValueProps, ref: Forwarde * SelectValue renders the current value of a Select, or a placeholder if no value is selected. * It is usually placed within the button element. */ -const _SelectValue = (forwardRef as forwardRefType)(SelectValue); +const _SelectValue = /*#__PURE__*/ (forwardRef as forwardRefType)(SelectValue); export {_SelectValue as SelectValue}; diff --git a/packages/react-aria-components/src/Slider.tsx b/packages/react-aria-components/src/Slider.tsx index 2798d9b3909..fb75f0440d1 100644 --- a/packages/react-aria-components/src/Slider.tsx +++ b/packages/react-aria-components/src/Slider.tsx @@ -87,7 +87,7 @@ function Slider(props: SliderProps, ref: Forward /** * A slider allows a user to select one or more values within a range. */ -const _Slider = (forwardRef as forwardRefType)(Slider); +const _Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(Slider); export {_Slider as Slider}; export interface SliderOutputProps extends RenderProps {} diff --git a/packages/react-aria-components/src/Tabs.tsx b/packages/react-aria-components/src/Tabs.tsx index 28727486dd5..2abb56a8a0c 100644 --- a/packages/react-aria-components/src/Tabs.tsx +++ b/packages/react-aria-components/src/Tabs.tsx @@ -185,7 +185,7 @@ function TabList(props: TabListProps, ref: ForwardedRef must match up with a corresponding item inside the . */ -const _TabList = (forwardRef as forwardRefType)(TabList); +const _TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(TabList); export {_TabList as TabList}; /**