mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
chore: turn on correctness.useHookAtTopLevel (#55110)
This commit is contained in:
@@ -52,7 +52,6 @@
|
||||
"correctness": {
|
||||
"useUniqueElementIds": "off",
|
||||
"useExhaustiveDependencies": "off",
|
||||
"useHookAtTopLevel": "off",
|
||||
"noUnusedFunctionParameters": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
|
||||
@@ -92,10 +92,12 @@ const InternalForm: React.ForwardRefRenderFunction<FormRef, FormProps> = (props,
|
||||
|
||||
const contextValidateMessages = React.useContext(ValidateMessagesContext);
|
||||
|
||||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
// biome-ignore lint/correctness/useHookAtTopLevel: Development-only warning hook called conditionally
|
||||
useFormWarning(props);
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
const mergedRequiredMark = React.useMemo(() => {
|
||||
if (requiredMark !== undefined) {
|
||||
|
||||
@@ -120,6 +120,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = devUseWarning('Input');
|
||||
|
||||
// biome-ignore lint/correctness/useHookAtTopLevel: Development-only warning hook called conditionally
|
||||
useEffect(() => {
|
||||
if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current) {
|
||||
warning(
|
||||
|
||||
Reference in New Issue
Block a user