Skip to content

Commit

Permalink
refactor(eslint-plugin-react-hooks): change array type and improve co…
Browse files Browse the repository at this point in the history
…nditionals (#32400)

- [build(eslint-plugin-react-hooks): add
ts-linting](4c0fbe7)
This change adds configuration to the eslint config governing
`eslint-plugin-react-hooks` to use the typescript-eslint plugin and
parser. It adds the typescript-recommended config, and configures the
team's preferred `array-type` convention.

- [refactor(eslint-plugin-react-hooks): improve
conditionals](540d0d9)
This change addresses several feedback items from
#32240

- [ci (eslint-e2e): exclude nested node_modules from
cache](a3279f4)
This change removes the nested fixture `node_modules` from being cached,
so that the symbolic link can be made after the build happens.

DiffTrain build for [4632e36](4632e36)
  • Loading branch information
poteto committed Feb 17, 2025
1 parent c25a671 commit dc8f660
Show file tree
Hide file tree
Showing 35 changed files with 95 additions and 95 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5adf40208f4a2f56bda5c059d18ce578c5091dab
4632e36a4ef16a1af24987c56e42b664f6403e64
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5adf40208f4a2f56bda5c059d18ce578c5091dab
4632e36a4ef16a1af24987c56e42b664f6403e64
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17394,10 +17394,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-5adf4020-20250216",
version: "19.1.0-www-classic-4632e36a-20250216",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-classic-4632e36a-20250216"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17431,7 +17431,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17166,10 +17166,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-5adf4020-20250216",
version: "19.1.0-www-modern-4632e36a-20250216",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-modern-4632e36a-20250216"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17203,7 +17203,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11257,10 +11257,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1550 = {
bundleType: 0,
version: "19.1.0-www-classic-5adf4020-20250216",
version: "19.1.0-www-classic-4632e36a-20250216",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-classic-4632e36a-20250216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1551 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -11286,4 +11286,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10972,10 +10972,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1523 = {
bundleType: 0,
version: "19.1.0-www-modern-5adf4020-20250216",
version: "19.1.0-www-modern-4632e36a-20250216",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-modern-4632e36a-20250216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1524 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -11001,4 +11001,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -28631,11 +28631,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-5adf4020-20250216" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-4632e36a-20250216" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-classic-5adf4020-20250216\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-4632e36a-20250216\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -28678,10 +28678,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-5adf4020-20250216",
version: "19.1.0-www-classic-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-classic-4632e36a-20250216"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -29279,7 +29279,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -28417,11 +28417,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-5adf4020-20250216" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-4632e36a-20250216" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-modern-5adf4020-20250216\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-4632e36a-20250216\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -28464,10 +28464,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-5adf4020-20250216",
version: "19.1.0-www-modern-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-modern-4632e36a-20250216"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -29065,7 +29065,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18425,14 +18425,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1854 = React.version;
if (
"19.1.0-www-classic-5adf4020-20250216" !==
"19.1.0-www-classic-4632e36a-20250216" !==
isomorphicReactPackageVersion$jscomp$inline_1854
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1854,
"19.1.0-www-classic-5adf4020-20250216"
"19.1.0-www-classic-4632e36a-20250216"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -18450,10 +18450,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2414 = {
bundleType: 0,
version: "19.1.0-www-classic-5adf4020-20250216",
version: "19.1.0-www-classic-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-classic-4632e36a-20250216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2415 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -18817,4 +18817,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -18156,14 +18156,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1844 = React.version;
if (
"19.1.0-www-modern-5adf4020-20250216" !==
"19.1.0-www-modern-4632e36a-20250216" !==
isomorphicReactPackageVersion$jscomp$inline_1844
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1844,
"19.1.0-www-modern-5adf4020-20250216"
"19.1.0-www-modern-4632e36a-20250216"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -18181,10 +18181,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2396 = {
bundleType: 0,
version: "19.1.0-www-modern-5adf4020-20250216",
version: "19.1.0-www-modern-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-modern-4632e36a-20250216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2397 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -18548,4 +18548,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19117,14 +19117,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1951 = React.version;
if (
"19.1.0-www-classic-5adf4020-20250216" !==
"19.1.0-www-classic-4632e36a-20250216" !==
isomorphicReactPackageVersion$jscomp$inline_1951
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1951,
"19.1.0-www-classic-5adf4020-20250216"
"19.1.0-www-classic-4632e36a-20250216"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -19142,10 +19142,10 @@ Internals.Events = [
];
var internals$jscomp$inline_1953 = {
bundleType: 0,
version: "19.1.0-www-classic-5adf4020-20250216",
version: "19.1.0-www-classic-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-classic-4632e36a-20250216"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1953.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -19512,7 +19512,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -18847,14 +18847,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1941 = React.version;
if (
"19.1.0-www-modern-5adf4020-20250216" !==
"19.1.0-www-modern-4632e36a-20250216" !==
isomorphicReactPackageVersion$jscomp$inline_1941
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1941,
"19.1.0-www-modern-5adf4020-20250216"
"19.1.0-www-modern-4632e36a-20250216"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -18872,10 +18872,10 @@ Internals.Events = [
];
var internals$jscomp$inline_1943 = {
bundleType: 0,
version: "19.1.0-www-modern-5adf4020-20250216",
version: "19.1.0-www-modern-4632e36a-20250216",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-5adf4020-20250216"
reconcilerVersion: "19.1.0-www-modern-4632e36a-20250216"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1943.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -19242,7 +19242,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9476,5 +9476,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
})();
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9302,5 +9302,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
})();
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6194,4 +6194,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-5adf4020-20250216";
exports.version = "19.1.0-www-classic-4632e36a-20250216";
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -6106,4 +6106,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-5adf4020-20250216";
exports.version = "19.1.0-www-modern-4632e36a-20250216";
Loading

0 comments on commit dc8f660

Please sign in to comment.