Skip to content

Commit 71ecb0f

Browse files
Bump eslint-plugin-react-hooks from 6.0.0-rc.1 to 7.0.0 (#14379)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pascal Birchler <pascalb@google.com>
1 parent fd7a3b3 commit 71ecb0f

File tree

82 files changed

+188
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+188
-114
lines changed

.eslintrc

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"plugin:import/recommended",
88
"plugin:@eslint-community/eslint-comments/recommended",
99
"plugin:react/recommended",
10-
"plugin:react-hooks/recommended-legacy",
10+
"plugin:react-hooks/recommended-latest",
1111
"plugin:prettier/recommended",
1212
"plugin:jsx-a11y/recommended",
1313
"plugin:jsdoc/recommended",
@@ -216,15 +216,21 @@
216216
"react/no-unused-prop-types": "error",
217217
"react/react-in-jsx-scope": "off",
218218
"react/self-closing-comp": "error",
219-
"react-hooks/react-compiler": [
220-
"error",
221-
{
222-
"environment": {
223-
"enableTreatRefLikeIdentifiersAsRefs": true,
224-
"validateRefAccessDuringRender": false
225-
}
226-
}
227-
],
219+
"react-hooks/config": "error",
220+
"react-hooks/error-boundaries": "error",
221+
"react-hooks/component-hook-factories": "error",
222+
"react-hooks/gating": "error",
223+
"react-hooks/globals": "error",
224+
"react-hooks/immutability": "error",
225+
"react-hooks/preserve-manual-memoization": "error",
226+
"react-hooks/purity": "error",
227+
"react-hooks/refs": "error",
228+
"react-hooks/set-state-in-effect": "error",
229+
"react-hooks/set-state-in-render": "error",
230+
"react-hooks/static-components": "error",
231+
"react-hooks/unsupported-syntax": "warn",
232+
"react-hooks/use-memo": "error",
233+
"react-hooks/incompatible-library": "warn",
228234
"import/no-extraneous-dependencies": "error",
229235
"import/no-unresolved": "error",
230236
"import/order": [
@@ -435,7 +441,8 @@
435441
"rules": {
436442
"@eslint-community/eslint-comments/require-description": "off",
437443
"react/prop-types": "off",
438-
"react-hooks/react-compiler": "off",
444+
"react-hooks/globals": "off",
445+
"react-hooks/immutability": "off",
439446
"jest/no-hooks": "off",
440447
"jest/no-untyped-mock-factory": "off",
441448
"jest/max-expects": "off",
@@ -957,10 +964,9 @@
957964
"packages/story-editor/src/components/videoTrim/useVideoNode.js",
958965
"packages/transform/src/useTransformHandler.ts",
959966
"packages/wp-story-editor/src/components/fontCheck/index.js"
960-
961967
],
962968
"rules": {
963-
"react-hooks/react-compiler": "off"
969+
"react-hooks/refs": "off"
964970
}
965971
}
966972
]

package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"eslint-plugin-oxlint": "^1.22.0",
120120
"eslint-plugin-prettier": "^5.5.4",
121121
"eslint-plugin-react": "^7.37.5",
122-
"eslint-plugin-react-hooks": "^6.0.0-rc.1",
122+
"eslint-plugin-react-hooks": "^7.0.0",
123123
"eslint-plugin-security": "^3.0.1",
124124
"eslint-plugin-styled-components-a11y": "^2.2.1",
125125
"eslint-plugin-testing-library": "^7.13.1",

packages/animation/src/components/AMPWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function ComposableWrapper({
6969
[animationParts]
7070
);
7171

72+
// eslint-disable-next-line react-hooks/static-components -- FIXME
7273
return <ComposedWrapper>{children}</ComposedWrapper>;
7374
}
7475
function AMPWrapper({ target, children }: WrapperProps) {

packages/animation/src/components/provider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ function Provider({
281281
return cancel;
282282
}, [filteredWAAPIAnimations, animationState, complete]);
283283

284+
// eslint-disable-next-line react-hooks/refs -- FIXME
284285
onWAAPIFinishRef.current = onWAAPIFinish;
285286
useEffect(() => {
286287
if (AnimationMachineState.Complete === animationState) {

packages/dashboard/src/app/views/myStories/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function MyStoriesView() {
8282
const isMountedRef = useRef(false);
8383

8484
useEffect(() => {
85-
// eslint-disable-next-line react-hooks/react-compiler -- FIXME
8685
isMountedRef.current = true;
8786

8887
return () => {

packages/dashboard/src/components/interfaceSkeleton/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const InterfaceSkeleton = ({ additionalRoutes }) => {
7676
currentPath === APP_ROUTES.DASHBOARD
7777
);
7878
const [isRedirectComplete, setIsRedirectComplete] = useState(
79+
// eslint-disable-next-line react-hooks/refs -- FIXME
7980
!isFirstLoadOnMyStoriesRef.current
8081
);
8182

packages/dashboard/src/utils/usePagePreviewSize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default function usePagePreviewSize(options = {}) {
115115

116116
const [availableContainerSpace, setAvailableContainerSpace] = useState(
117117
getContainerWidth(
118+
// eslint-disable-next-line react-hooks/refs -- FIXME
118119
dashboardContainerRef.current?.offsetWidth || window.innerWidth
119120
)
120121
);

packages/dashboard/src/utils/useStoryView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export default function useStoryView({
9090
}, [viewStyle, setViewStyle]);
9191

9292
const requestNextPage = useCallback(() => {
93-
// eslint-disable-next-line react-hooks/react-compiler -- FIXME
9493
showStoriesWhileLoadingRef.current = true;
9594
setPageClamped(page + 1);
9695
}, [page, setPageClamped]);

packages/design-system/src/components/contextMenu/contextMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const ContextMenu = forwardRef(
6060
isHorizontal={isHorizontal}
6161
onDismiss={onDismiss}
6262
>
63+
{/* eslint-disable-next-line react-hooks/static-components -- FIXME */}
6364
<Wrapper
6465
aria-label={ariaLabel}
6566
isInline={isInline}

0 commit comments

Comments
 (0)