UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

319 lines (318 loc) • 7.07 kB
import { noInlineFormSchema } from "./noInlineFormSchema.mjs"; //#region src/eslint/index.ts const DEPRECATED_UI_COMPONENTS = [ "Accordion", "AccordionItem", "ActionIcon", "Alert", "AutoComplete", "Avatar", "AvatarGroup", "Burger", "Button", "Checkbox", "CheckboxGroup", "Collapse", "DatePicker", "DraggablePanel", "DraggablePanelBody", "DraggablePanelContainer", "DraggablePanelFooter", "DraggablePanelHeader", "Drawer", "Dropdown", "FormSubmitFooter", "FormTitle", "Input", "InputNumber", "InputOPT", "InputPassword", "Modal", "ModalHost", "Radio", "RadioGroup", "Segmented", "Select", "Skeleton", "SkeletonAvatar", "SkeletonBlock", "SkeletonButton", "SkeletonParagraph", "SkeletonTags", "SkeletonTitle", "Slider", "SliderWithInput", "Switch", "Tabs", "Tag", "Text", "TextArea", "Tree" ]; const DEPRECATED_ANTD_ONLY = [ "Anchor", "Badge", "Breadcrumb", "Card", "Carousel", "ColorPicker", "Descriptions", "Divider", "Empty", "FloatButton", "List", "Menu", "Pagination", "Popover", "Progress", "QRCode", "Rate", "Result", "Spin", "Statistic", "Steps", "Table", "Tooltip", "Typography", "Upload" ]; const DEPRECATED_FORM_EXPORTS = [ "Form", "FormDivider", "FormFlatGroup", "FormFooter", "FormGroup", "FormGroupItemType", "FormInstance", "FormItem", "FormItemProps", "FormModal", "FormModalProps", "FormProps" ]; const FORM_MIGRATION_MESSAGE = "Use `Form`, `useForm` and their types from \"@lobehub/ui/base-ui/form\" instead."; const DEPRECATED_ANTD_COMPONENT_PATHS = [ "antd/es/alert", "antd/es/alert/*", "antd/es/anchor", "antd/es/anchor/*", "antd/es/auto-complete", "antd/es/auto-complete/*", "antd/es/badge", "antd/es/badge/*", "antd/es/breadcrumb", "antd/es/breadcrumb/*", "antd/es/card", "antd/es/card/*", "antd/es/carousel", "antd/es/carousel/*", "antd/es/checkbox", "antd/es/checkbox/*", "antd/es/collapse", "antd/es/collapse/*", "antd/es/color-picker", "antd/es/color-picker/*", "antd/es/date-picker", "antd/es/date-picker/*", "antd/es/descriptions", "antd/es/descriptions/*", "antd/es/divider", "antd/es/divider/*", "antd/es/dropdown", "antd/es/dropdown/*", "antd/es/empty", "antd/es/empty/*", "antd/es/float-button", "antd/es/float-button/*", "antd/es/input", "antd/es/input-number", "antd/es/input-number/*", "antd/es/input/*", "antd/es/list", "antd/es/list/*", "antd/es/message", "antd/es/message/*", "antd/es/notification", "antd/es/notification/*", "antd/es/pagination", "antd/es/pagination/*", "antd/es/popover", "antd/es/popover/*", "antd/es/progress", "antd/es/progress/*", "antd/es/qr-code", "antd/es/qr-code/*", "antd/es/radio", "antd/es/radio/*", "antd/es/rate", "antd/es/rate/*", "antd/es/result", "antd/es/result/*", "antd/es/skeleton", "antd/es/skeleton/*", "antd/es/slider", "antd/es/slider/*", "antd/es/spin", "antd/es/spin/*", "antd/es/statistic", "antd/es/statistic/*", "antd/es/steps", "antd/es/steps/*", "antd/es/switch", "antd/es/switch/*", "antd/es/table", "antd/es/table/*", "antd/es/tooltip", "antd/es/tooltip/*", "antd/es/tree", "antd/es/tree/*", "antd/es/typography", "antd/es/typography/*", "antd/es/upload", "antd/es/upload/*", "antd/lib/alert", "antd/lib/alert/*", "antd/lib/anchor", "antd/lib/anchor/*", "antd/lib/auto-complete", "antd/lib/auto-complete/*", "antd/lib/badge", "antd/lib/badge/*", "antd/lib/breadcrumb", "antd/lib/breadcrumb/*", "antd/lib/card", "antd/lib/card/*", "antd/lib/carousel", "antd/lib/carousel/*", "antd/lib/checkbox", "antd/lib/checkbox/*", "antd/lib/collapse", "antd/lib/collapse/*", "antd/lib/color-picker", "antd/lib/color-picker/*", "antd/lib/date-picker", "antd/lib/date-picker/*", "antd/lib/descriptions", "antd/lib/descriptions/*", "antd/lib/divider", "antd/lib/divider/*", "antd/lib/dropdown", "antd/lib/dropdown/*", "antd/lib/empty", "antd/lib/empty/*", "antd/lib/float-button", "antd/lib/float-button/*", "antd/lib/input", "antd/lib/input-number", "antd/lib/input-number/*", "antd/lib/input/*", "antd/lib/list", "antd/lib/list/*", "antd/lib/message", "antd/lib/message/*", "antd/lib/notification", "antd/lib/notification/*", "antd/lib/pagination", "antd/lib/pagination/*", "antd/lib/popover", "antd/lib/popover/*", "antd/lib/progress", "antd/lib/progress/*", "antd/lib/qr-code", "antd/lib/qr-code/*", "antd/lib/radio", "antd/lib/radio/*", "antd/lib/rate", "antd/lib/rate/*", "antd/lib/result", "antd/lib/result/*", "antd/lib/skeleton", "antd/lib/skeleton/*", "antd/lib/slider", "antd/lib/slider/*", "antd/lib/spin", "antd/lib/spin/*", "antd/lib/statistic", "antd/lib/statistic/*", "antd/lib/steps", "antd/lib/steps/*", "antd/lib/switch", "antd/lib/switch/*", "antd/lib/table", "antd/lib/table/*", "antd/lib/tooltip", "antd/lib/tooltip/*", "antd/lib/tree", "antd/lib/tree/*", "antd/lib/typography", "antd/lib/typography/*", "antd/lib/upload", "antd/lib/upload/*" ]; const restrictedImports = { rules: { "no-restricted-imports": ["error", { paths: [ { importNames: DEPRECATED_UI_COMPONENTS, message: "The antd-based wrapper is deprecated. Import from \"@lobehub/ui/base-ui\" instead.", name: "@lobehub/ui" }, { importNames: DEPRECATED_FORM_EXPORTS, message: FORM_MIGRATION_MESSAGE, name: "@lobehub/ui" }, { importNames: DEPRECATED_FORM_EXPORTS, message: FORM_MIGRATION_MESSAGE, name: "antd" }, { importNames: ["createStyles"], message: "`createStyles` is banned in this project. Use `createStaticStyles` from \"antd-style\" instead.", name: "antd-style" }, { importNames: [...DEPRECATED_UI_COMPONENTS, ...DEPRECATED_ANTD_ONLY], message: "Direct antd import is deprecated. Import from \"@lobehub/ui/base-ui\" instead.", name: "antd" }, { importNames: ["message", "notification"], message: "antd feedback APIs are deprecated. Use `toast` from \"@lobehub/ui/base-ui\".", name: "antd" }, { importNames: ["LoadingOutlined"], message: "Use `Spin` from \"@lobehub/ui/base-ui\" instead of a hand-rolled spinner.", name: "@ant-design/icons" }, { message: "Use `Spin variant=\"network\"` from \"@lobehub/ui/base-ui\" instead.", name: "thinking-orbs" }, { message: "ProComponents are deprecated. Use `Table` from \"@lobehub/ui/base-ui\" instead.", name: "@ant-design/pro-components" } ], patterns: [{ group: [ "antd/es/form", "antd/es/form/*", "antd/lib/form", "antd/lib/form/*" ], message: FORM_MIGRATION_MESSAGE }, { group: DEPRECATED_ANTD_COMPONENT_PATHS, message: "Direct antd component import is deprecated. Import from \"@lobehub/ui/base-ui\" instead." }] }] } }; const formSchemaRules = { plugins: { "@lobehub/ui": { rules: { "no-inline-form-schema": noInlineFormSchema } } }, rules: { "@lobehub/ui/no-inline-form-schema": "warn" } }; var eslint_default = [restrictedImports, formSchemaRules]; //#endregion export { eslint_default as default, formSchemaRules, restrictedImports }; //# sourceMappingURL=index.mjs.map