diff --git a/desktop/.eslintrc.js b/desktop/.eslintrc.js
index a07ca7547..5750af45e 100644
--- a/desktop/.eslintrc.js
+++ b/desktop/.eslintrc.js
@@ -66,6 +66,26 @@ const restrictedImportsUniversalErrorConfig = {
message:
"Imports from nested flipper-ui-core directories are not allowed. Import from 'flipper-ui-core' module directly. If it is missing an export, add it there.",
},
+ {
+ group: ['antd/*'],
+ message:
+ "Imports from nested antd directories are not allowed. Import from 'antd' module directly. If you want to import only a type, use `import type` syntax and silence this warning.",
+ },
+ {
+ group: ['immer/*'],
+ message:
+ "Imports from nested antd directories are not allowed. Import from 'antd' module directly. If you want to import only a type, use `import type` syntax and silence this warning.",
+ },
+ {
+ group: ['@emotion/styled/*'],
+ message:
+ "Imports from nested @emotion/styled directories are not allowed. Import from '@emotion/styled' module directly. If you want to import only a type, use `import type` syntax and silence this warning.",
+ },
+ {
+ group: ['@ant-design/icons/*'],
+ message:
+ "Imports from nested @ant-design/icons directories are not allowed. Import from '@ant-design/icons' module directly. If you want to import only a type, use `import type` syntax and silence this warning.",
+ },
],
};
diff --git a/desktop/flipper-plugin/src/ui/CodeBlock.tsx b/desktop/flipper-plugin/src/ui/CodeBlock.tsx
index 4d78650da..ba4815fa4 100644
--- a/desktop/flipper-plugin/src/ui/CodeBlock.tsx
+++ b/desktop/flipper-plugin/src/ui/CodeBlock.tsx
@@ -10,7 +10,9 @@
import React from 'react';
import {Typography} from 'antd';
import styled from '@emotion/styled';
-import {ParagraphProps} from 'antd/lib/typography/Paragraph';
+// This import is OK since it is a type-only import
+// eslint-disable-next-line no-restricted-imports
+import type {ParagraphProps} from 'antd/lib/typography/Paragraph';
export function CodeBlock({children, ...props}: ParagraphProps) {
return (
diff --git a/desktop/flipper-plugin/src/ui/NUX.tsx b/desktop/flipper-plugin/src/ui/NUX.tsx
index eedac6269..b01b62f7b 100644
--- a/desktop/flipper-plugin/src/ui/NUX.tsx
+++ b/desktop/flipper-plugin/src/ui/NUX.tsx
@@ -24,6 +24,8 @@ import {useValue} from '../state/atom';
import {_SandyDevicePluginInstance} from 'flipper-plugin-core';
import {Layout} from './Layout';
import {BulbTwoTone} from '@ant-design/icons';
+// This import is OK since it is a type-only import
+// eslint-disable-next-line no-restricted-imports
import type {TooltipPlacement} from 'antd/lib/tooltip';
import {_SandyPluginInstance} from 'flipper-plugin-core';
import {theme} from './theme';
diff --git a/desktop/flipper-plugin/src/ui/data-inspector/DataDescription.tsx b/desktop/flipper-plugin/src/ui/data-inspector/DataDescription.tsx
index e6374f0e3..f72d3cb12 100644
--- a/desktop/flipper-plugin/src/ui/data-inspector/DataDescription.tsx
+++ b/desktop/flipper-plugin/src/ui/data-inspector/DataDescription.tsx
@@ -18,6 +18,8 @@ import {parseColor} from '../../utils/parseColor';
import {TimelineDataDescription} from './TimelineDataDescription';
import {theme} from '../theme';
import {EditOutlined} from '@ant-design/icons';
+// This import is OK since it is a type-only import
+// eslint-disable-next-line no-restricted-imports
import type {CheckboxChangeEvent} from 'antd/lib/checkbox';
const {Link} = Typography;
diff --git a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx
index b2227209c..75f1de626 100644
--- a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx
+++ b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx
@@ -54,7 +54,6 @@ import FpsGraph from '../chrome/FpsGraph';
import UpdateIndicator from '../chrome/UpdateIndicator';
import PluginManager from '../chrome/plugin-manager/PluginManager';
import {showLoginDialog} from '../chrome/fb-stubs/SignInSheet';
-import SubMenu from 'antd/lib/menu/SubMenu';
import constants from '../fb-stubs/constants';
import {
canFileExport,
@@ -260,7 +259,7 @@ function ExtrasMenu() {
className={menu}
selectable={false}
style={{backgroundColor: theme.backgroundDefault}}>
-