Skip to content

Commit

Permalink
style: add eslint rule to separate type and code imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyman committed Dec 13, 2022
1 parent 60c3a26 commit ca530ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"react/jsx-indent-props": 0,
"react/prop-types": 0,

"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unused-vars": [
Expand Down
9 changes: 2 additions & 7 deletions src/ReactCompareSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import type { CSSProperties, FC, ReactElement } from 'react';
import { ContainerClip, ContainerHandle } from './Container';
import { ReactCompareSliderHandle } from './ReactCompareSliderHandle';
import type { ReactCompareSliderDetailedProps } from './types';
import {
KeyboardEventKeys,
UseResizeObserverHandlerProps,
useEventListener,
usePrevious,
useResizeObserver,
} from './utils';
import type { UseResizeObserverHandlerProps } from './utils';
import { KeyboardEventKeys, useEventListener, usePrevious, useResizeObserver } from './utils';

/** Properties for internal `updateInternalPosition` callback. */
interface UpdateInternalPositionProps
Expand Down
2 changes: 1 addition & 1 deletion src/ReactCompareSliderHandle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { CSSProperties, FC, HtmlHTMLAttributes, ReactElement } from 'react';

import { ReactCompareSliderCommonProps } from './types';
import type { ReactCompareSliderCommonProps } from './types';

interface ThisArrowProps {
/** Whether to flip the arrow direction. */
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 { RefObject, useCallback, useEffect, useLayoutEffect, useRef } from 'react';
import type { CSSProperties } from 'react';
import type { CSSProperties, RefObject } from 'react';
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';

/** Keyboard `key` events to trigger slider movement. */
export enum KeyboardEventKeys {
Expand Down

0 comments on commit ca530ba

Please sign in to comment.