Skip to content

Commit

Permalink
chore: consistent type exports/imports and add eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
YSMJ1994 committed Feb 21, 2024
1 parent 0384848 commit d788888
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"@alifd/eslint-config-next",
"plugin:@typescript-eslint/recommended",
Expand All @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -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<string, unknown>;

Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down

0 comments on commit d788888

Please sign in to comment.