mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
feat: eslint add rule prefer top level type import (#3354)
This commit is contained in:
parent
1cd64b2e2e
commit
167e1977ee
@ -87,6 +87,7 @@
|
||||
"prev": ["const", "let", "var"],
|
||||
"next": ["const", "let", "var"]
|
||||
}
|
||||
]
|
||||
],
|
||||
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
"test": "jest --verbose --config ./jest.config.js",
|
||||
"typecheck": "turbo typecheck",
|
||||
"lint": "pnpm lint:pkg && pnpm lint:docs",
|
||||
"lint:pkg": "eslint -c .eslintrc.json ./packages/**/**/*.{ts,tsx}",
|
||||
"lint:pkg": "eslint -c .eslintrc.json ./packages/**/*.{ts,tsx}",
|
||||
"lint:docs": "eslint -c .eslintrc.json ./apps/docs/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint --fix -c .eslintrc.json ./packages/**/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint --fix -c .eslintrc.json ./packages/**/*.{ts,tsx}",
|
||||
"lint:docs-fix": "eslint --fix -c .eslintrc.json ./apps/docs/**/*.{ts,tsx}",
|
||||
"check:rap": "tsx scripts/check-rap-updates.ts",
|
||||
"fix:rap": "tsx scripts/fix-rap.ts",
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import type {SelectionBehavior, MultipleSelection} from "@react-types/shared";
|
||||
import type {AriaAccordionProps} from "@react-types/accordion";
|
||||
import type {AccordionGroupVariantProps} from "@nextui-org/theme";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {ReactRef, filterDOMProps} from "@nextui-org/react-utils";
|
||||
import React, {Key, useCallback} from "react";
|
||||
import {TreeState, useTreeState} from "@react-stately/tree";
|
||||
|
||||
@ -2,8 +2,9 @@ import type {ButtonVariantProps} from "@nextui-org/theme";
|
||||
import type {AriaButtonProps} from "@nextui-org/use-aria-button";
|
||||
import type {ReactNode} from "react";
|
||||
import type {RippleProps} from "@nextui-org/ripple";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {dataAttr} from "@nextui-org/shared-utils";
|
||||
import {ReactRef} from "@nextui-org/react-utils";
|
||||
import {MouseEventHandler, useCallback} from "react";
|
||||
|
||||
@ -3,8 +3,9 @@ import type {AriaCheckboxGroupProps} from "@react-types/checkbox";
|
||||
import type {Orientation} from "@react-types/shared";
|
||||
import type {ReactRef} from "@nextui-org/react-utils";
|
||||
import type {CheckboxGroupProps} from "@react-types/checkbox";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {useCallback, useMemo} from "react";
|
||||
import {chain, mergeProps} from "@react-aria/utils";
|
||||
import {checkboxGroup} from "@nextui-org/theme";
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import type {CheckboxVariantProps, CheckboxSlots, SlotsToClasses} from "@nextui-org/theme";
|
||||
import type {AriaCheckboxProps} from "@react-types/checkbox";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {ReactNode, Ref, useCallback, useId, useState} from "react";
|
||||
import {useMemo, useRef} from "react";
|
||||
import {useToggleState} from "@react-stately/toggle";
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import type {PopoverProps} from "@nextui-org/popover";
|
||||
import type {MenuTriggerType} from "@react-types/menu";
|
||||
import type {Ref} from "react";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {useMenuTriggerState} from "@react-stately/menu";
|
||||
import {useMenuTrigger} from "@react-aria/menu";
|
||||
import {dropdown} from "@nextui-org/theme";
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import {useProviderContext, type HTMLNextUIProps, type PropGetter} from "@nextui-org/system";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {useProviderContext} from "@nextui-org/system";
|
||||
import {AriaMenuProps} from "@react-types/menu";
|
||||
import {AriaMenuOptions} from "@react-aria/menu";
|
||||
import {useAriaMenu} from "@nextui-org/use-aria-menu";
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import type {SelectProps} from "../src";
|
||||
|
||||
import * as React from "react";
|
||||
import {render, renderHook, act} from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import {useForm} from "react-hook-form";
|
||||
|
||||
import {Select, SelectItem, SelectSection, type SelectProps} from "../src";
|
||||
import {Select, SelectItem, SelectSection} from "../src";
|
||||
import {Modal, ModalContent, ModalHeader, ModalBody, ModalFooter} from "../../modal/src";
|
||||
|
||||
type Item = {
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import type {HTMLNextUIProps} from "../src/types";
|
||||
import type {VariantProps} from "@nextui-org/theme";
|
||||
|
||||
import React, {useMemo} from "react";
|
||||
import {tv, type VariantProps} from "@nextui-org/theme";
|
||||
import {tv} from "@nextui-org/theme";
|
||||
import {filterDOMProps, ReactRef, useDOMRef} from "@nextui-org/react-utils";
|
||||
import {objectToDeps} from "@nextui-org/shared-utils";
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import type {HTMLNextUIProps} from "../src/types";
|
||||
import type {VariantProps} from "@nextui-org/theme";
|
||||
|
||||
import React, {useMemo} from "react";
|
||||
import {SlotsToClasses, tv, type VariantProps} from "@nextui-org/theme";
|
||||
import {SlotsToClasses, tv} from "@nextui-org/theme";
|
||||
import {filterDOMProps, ReactRef, useDOMRef} from "@nextui-org/react-utils";
|
||||
import {objectToDeps} from "@nextui-org/shared-utils";
|
||||
import clsx from "clsx";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user