diff --git a/packages/@react-spectrum/s2/style/style-macro.ts b/packages/@react-spectrum/s2/style/style-macro.ts index a099df6ef9e..cce10985a24 100644 --- a/packages/@react-spectrum/s2/style/style-macro.ts +++ b/packages/@react-spectrum/s2/style/style-macro.ts @@ -419,6 +419,7 @@ export function createTheme( let prop = properties.get(property); if (prop) { for (let property of prop.cssProperties) { + // oxlint-disable-next-line max-depth if (property && allowedOverridesSet.has(property)) { let selector = classNamePrefix(property, property); let p = property.replace('--', '__'); diff --git a/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/styleProps.ts b/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/styleProps.ts index 1dc6282edfa..23968cbc5b5 100644 --- a/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/styleProps.ts +++ b/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/styleProps.ts @@ -289,10 +289,12 @@ function getStylePropValue( } else if (value.type === 'ArrayExpression') { let values: string[] = []; for (let element of value.elements) { + // oxlint-disable-next-line max-depth if (element?.type === 'StringLiteral' || element?.type === 'NumericLiteral') { values.push(convertGridTrack(element.value) as string); } else if (element?.type === 'CallExpression') { // TODO: match to import using scope + // oxlint-disable-next-line max-depth if ( element.callee.type === 'Identifier' && element.callee.name === 'minmax' && @@ -352,6 +354,7 @@ function getStylePropValue( if (prop === 'padding' && value.type === 'StringLiteral' && /\s/.test(value.value)) { // Check if it has multiple whitespace-separated values let expansions = expandSpaceShorthand(prop, value.value, convertDimension); + // oxlint-disable-next-line max-depth if (!expansions) { return null; } @@ -680,11 +683,13 @@ export default function transformStyleProps( macroValues.set(val.key, val.value); } if (value.dynamicValues) { + // oxlint-disable-next-line max-depth for (let val of value.dynamicValues) { dynamicValues.set(val.key, val.value); } } if (value.conditions) { + // oxlint-disable-next-line max-depth for (let val of value.conditions) { conditions.set(val.key, val.value); } diff --git a/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/unsafeStyle.ts b/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/unsafeStyle.ts index 2a334683150..b972f919289 100644 --- a/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/unsafeStyle.ts +++ b/packages/dev/codemods/src/s1-to-s2/src/codemods/shared/unsafeStyle.ts @@ -250,6 +250,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper } else if (value.type === 'StringLiteral') { let m = value.value.match(/^var\(--spectrum-global-dimension-font-size-(.+)\)$/); if (m) { + // oxlint-disable-next-line max-depth switch (m[1]) { case '25': return `[${10 / 16}rem]`; @@ -296,6 +297,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper if (value.type === 'StringLiteral') { let m = value.value.match(/^var\(--spectrum-global-font-weight-(.+)\)$/); if (m) { + // oxlint-disable-next-line max-depth switch (m[1]) { case 'light': case 'medium': @@ -307,6 +309,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper return 'normal'; } } else { + // oxlint-disable-next-line max-depth switch (value.value) { case 'normal': case 'bold': @@ -443,6 +446,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper if (value.type === 'StringLiteral') { let m = value.value.match(/^var\(--spectrum-global-animation-duration-(.+)\)$/); if (m) { + // oxlint-disable-next-line max-depth switch (m[1]) { case '0': return 0; diff --git a/packages/dev/docs/pages/blog/SubmenuAnimation.tsx b/packages/dev/docs/pages/blog/SubmenuAnimation.tsx index 8f9aae64947..c77abb68d18 100644 --- a/packages/dev/docs/pages/blog/SubmenuAnimation.tsx +++ b/packages/dev/docs/pages/blog/SubmenuAnimation.tsx @@ -106,11 +106,12 @@ export function SubmenuAnimation(): JSX.Element { } ]); + let mouseCurrent = mouseRef.current!; return () => { cancel(); setIsSubmenuOpen(false); setHovered('Option 1'); - mouseRef.current!.getAnimations().forEach(a => a.cancel()); + mouseCurrent.getAnimations().forEach(a => a.cancel()); isAnimating.current = false; }; }; diff --git a/packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs b/packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs index c07f5013de1..ea1b81d5ef5 100644 --- a/packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs +++ b/packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs @@ -1773,6 +1773,7 @@ function remarkDocsComponentsToMarkdown() { const desc = getComponentDescription(m[1], file); if (desc) { // Replace with normal paragraph node. + // oxlint-disable-next-line max-depth if (node.type === 'mdxJsxFlowElement') { parent.children[index] = { type: 'paragraph', diff --git a/packages/react-aria/src/combobox/useComboBox.ts b/packages/react-aria/src/combobox/useComboBox.ts index b6a0095daf7..78a2e9c03b0 100644 --- a/packages/react-aria/src/combobox/useComboBox.ts +++ b/packages/react-aria/src/combobox/useComboBox.ts @@ -520,7 +520,7 @@ function useValueId(depArray: ReadonlyArray = []): string | undefined { useEffect(() => { if (exists && !document.getElementById(id)) { - // eslint-disable-next-line react-hooks/set-state-in-effect + // oxlint-disable-next-line react-hooks-js/set-state-in-effect setExists(false); } }, [id, exists, lastDeps]); diff --git a/packages/react-aria/src/focus/FocusScope.tsx b/packages/react-aria/src/focus/FocusScope.tsx index b8885122112..bcb558fb804 100644 --- a/packages/react-aria/src/focus/FocusScope.tsx +++ b/packages/react-aria/src/focus/FocusScope.tsx @@ -802,9 +802,12 @@ function useRestoreFocus( while (treeNode) { if ( treeNode.scopeRef && + // TODO: this is probably a false positive based on naming, it's not a real ref, rename. + // oxlint-disable-next-line react-hooks/exhaustive-deps treeNode.scopeRef.current && focusScopeTree.getTreeNode(treeNode.scopeRef) ) { + // oxlint-disable-next-line react-hooks/exhaustive-deps let node = getFirstInScope(treeNode.scopeRef.current, true); restoreFocusToElement(node); return; diff --git a/packages/react-aria/src/gridlist/useGridListItem.ts b/packages/react-aria/src/gridlist/useGridListItem.ts index 6a29edf0b6d..d70ea835356 100644 --- a/packages/react-aria/src/gridlist/useGridListItem.ts +++ b/packages/react-aria/src/gridlist/useGridListItem.ts @@ -237,6 +237,7 @@ export function useGridListItem( } else { walker.currentNode = ref.current; let lastElement = last(walker); + // oxlint-disable-next-line max-depth if (lastElement) { focusSafely(lastElement); scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)}); @@ -267,6 +268,7 @@ export function useGridListItem( } else { walker.currentNode = ref.current; let lastElement = last(walker); + // oxlint-disable-next-line max-depth if (lastElement) { focusSafely(lastElement); scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)}); diff --git a/packages/react-aria/src/selection/useSelectableCollection.ts b/packages/react-aria/src/selection/useSelectableCollection.ts index 127f5ce51ba..4ecad56edbf 100644 --- a/packages/react-aria/src/selection/useSelectableCollection.ts +++ b/packages/react-aria/src/selection/useSelectableCollection.ts @@ -367,6 +367,7 @@ export function useSelectableCollection( let last: FocusableElement; do { last = walker.lastChild() as FocusableElement; + // oxlint-disable-next-line max-depth if (last) { next = last; } diff --git a/packages/react-aria/src/utils/useSyncRef.ts b/packages/react-aria/src/utils/useSyncRef.ts index 8e1e92bf932..d25990a0d56 100644 --- a/packages/react-aria/src/utils/useSyncRef.ts +++ b/packages/react-aria/src/utils/useSyncRef.ts @@ -25,6 +25,7 @@ export function useSyncRef(context?: ContextValue | null, ref?: RefObject< context.ref.current = ref.current; return () => { if (context.ref) { + // oxlint-disable-next-line react-hooks/exhaustive-deps context.ref.current = null; } }; diff --git a/starters/tailwind/stories/Table.stories.tsx b/starters/tailwind/stories/Table.stories.tsx index 64b7715ad50..54cf3454bdd 100644 --- a/starters/tailwind/stories/Table.stories.tsx +++ b/starters/tailwind/stories/Table.stories.tsx @@ -1,7 +1,6 @@ import {type Meta} from '@storybook/react'; import React, {useMemo, useState} from 'react'; -import {TableBody} from 'react-aria-components/Table'; -import {Cell, Column, Row, Table, TableHeader} from '../src/Table'; +import {Cell, Column, Row, Table, TableBody, TableHeader} from '../src/Table'; const meta: Meta = { component: Table,