diff --git a/.eslintrc b/.eslintrc index 94d3ed3..7017d6d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,6 +4,9 @@ "node": true }, "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, "extends": [ "@alifd/eslint-config-next", "plugin:@typescript-eslint/recommended", @@ -30,6 +33,8 @@ "react/jsx-filename-extension": ["error", { "extensions": [".tsx", ".jsx"] }], "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-this-alias": "warn" + "@typescript-eslint/no-this-alias": "warn", + "@typescript-eslint/consistent-type-exports": "warn", + "@typescript-eslint/consistent-type-imports": "warn" } } diff --git a/src/types.ts b/src/types.ts index 4cc2b3d..e7d1878 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,7 @@ import type { MessagesConfig, PresetFormatter, Validator } from '@alifd/validate'; import type { Component, useState, useMemo, Dispatch, SetStateAction, Ref, RefCallback } from 'react'; -export { Validator }; +export type { Validator }; export type FieldValues = Record; diff --git a/src/utils.ts b/src/utils.ts index ea9b86b..6ee3771 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ -import { ChangeEvent } from 'react'; -import { UnknownFunction } from './types'; +import type { ChangeEvent } from 'react'; +import type { UnknownFunction } from './types'; export function splitNameToPath(name: ''): ''; export function splitNameToPath(name: string): string[];