Skip to content

Commit b3099a8

Browse files
style: better import sorting
1 parent cd3c75d commit b3099a8

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

src/_internals/eval.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import { Children, createElement, Fragment, ReactNode } from 'react';
2-
import { isMatching } from 'ts-pattern';
1+
import { Children, Fragment, ReactNode, createElement } from 'react';
2+
33
import isEmpty from 'lodash/isEmpty';
44
import pick from 'lodash/pick';
5+
import { isMatching } from 'ts-pattern';
56

6-
import { When, WhenProps } from '../components/When';
7-
import { With, WithProps } from '../components/With';
87
import { Exact, ExactProps } from '../components/Exact';
98
import { Otherwise } from '../components/Otherwise';
9+
import { When, WhenProps } from '../components/When';
10+
import { With, WithProps } from '../components/With';
1011

12+
import { exceptions, invariant } from './error';
1113
import {
1214
ElementWithMetadata,
1315
ElementWithMetadataUnion,
1416
MatchWithCase,
1517
PatternUnion,
1618
} from './types';
17-
import { exceptions, invariant } from './error';
1819

1920
// ----------------------------------------------------------------------
2021
//

src/_internals/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { PropsWithChildren, ReactElement } from 'react';
2+
23
import { Pattern } from 'ts-pattern';
34
import { NotPattern } from 'ts-pattern/lib/types/Pattern';
45

6+
import { ExactProps } from '../components/Exact';
57
import { WhenProps } from '../components/When';
68
import { WithProps } from '../components/With';
7-
import { ExactProps } from '../components/Exact';
89

910
export type PatternUnion<Shape extends {}> = Pattern<Shape> | NotPattern<Shape>;
1011

src/components/Exact/Exact.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { ReactNode } from 'react';
2+
23
import isNil from 'lodash/isNil';
34

4-
import { DeepPatternUnion } from '../../_internals/types';
55
import { exceptions, invariant } from '../../_internals/error';
6+
import { DeepPatternUnion } from '../../_internals/types';
67

78
export type ExactProps<Shape extends {}> = DeepPatternUnion<Shape, true> & {
89
/** Any node to be rendered when its other props match the `value`

src/components/Match/Match.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { Children, ReactElement } from 'react';
22

3+
import { exceptions, invariant } from '../../_internals/error';
34
import {
5+
elementWithMetadataToElement,
6+
evaluate,
7+
nodesToElementWithMetadata,
8+
parseChildren,
9+
} from '../../_internals/eval';
10+
11+
import {
12+
ExactProps,
413
OtherwiseProps,
514
WhenProps,
615
WithProps,
7-
ExactProps,
816
} from '../../components';
9-
import {
10-
nodesToElementWithMetadata,
11-
parseChildren,
12-
elementWithMetadataToElement,
13-
evaluate,
14-
} from '../../_internals/eval';
15-
import { exceptions, invariant } from '../../_internals/error';
1617

1718
export interface MatchProps<Shape extends {}> {
1819
/** Entry point to create a pattern-matching expression. */

src/components/Otherwise/Otherwise.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { ReactNode } from 'react';
2+
23
import isNil from 'lodash/isNil';
34

45
import { exceptions, invariant } from '../../_internals/error';

src/components/When/When.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { ReactNode } from 'react';
2+
23
import isNil from 'lodash/isNil';
34

45
import { exceptions, invariant } from '../../_internals/error';

src/components/With/With.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { ReactNode } from 'react';
2+
23
import isNil from 'lodash/isNil';
34

4-
import { DeepPatternUnion } from '../../_internals/types';
55
import { exceptions, invariant } from '../../_internals/error';
6+
import { DeepPatternUnion } from '../../_internals/types';
67

78
export type WithProps<Shape extends {}> = DeepPatternUnion<Shape, false> & {
89
/** Any node to be rendered when its other props match the `value`

src/utils/pattern-match.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { ComponentType } from 'react';
22

33
import {
4+
Exact,
5+
ExactProps,
46
Match,
57
MatchProps,
8+
Otherwise,
69
Switch,
710
SwitchProps,
811
When,
912
WhenProps,
1013
With,
1114
WithProps,
12-
Exact,
13-
ExactProps,
14-
Otherwise,
1515
} from '../components';
1616

1717
export const getPatternMatch = <Shape extends {}>(

0 commit comments

Comments
 (0)