Skip to content

Commit

Permalink
Enable type imports (#116)
Browse files Browse the repository at this point in the history
## **This PR**:

- [X] Enables `type` imports.
  • Loading branch information
aryaemami59 authored Sep 21, 2024
1 parent 86be766 commit c2278a5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/branding.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ConstructorOverloadParameters, NumOverloads, OverloadsInfoUnion} from './overloads'
import {
import type {ConstructorOverloadParameters, NumOverloads, OverloadsInfoUnion} from './overloads'
import type {
IsNever,
IsAny,
IsUnknown,
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {StrictEqualUsingBranding} from './branding'
import {
import type {StrictEqualUsingBranding} from './branding'
import type {
MismatchInfo,
Scolder,
ExpectAny,
Expand All @@ -17,13 +17,13 @@ import {
ExpectUndefined,
ExpectNullable,
} from './messages'
import {
import type {
ConstructorOverloadParameters,
OverloadParameters,
OverloadReturnTypes,
OverloadsNarrowedByParameters,
} from './overloads'
import {StrictEqualUsingTSInternalIdenticalToOperator, AValue, MismatchArgs, Extends} from './utils'
import type {StrictEqualUsingTSInternalIdenticalToOperator, AValue, MismatchArgs, Extends} from './utils'

export * from './branding' // backcompat, consider removing in next major version
export * from './utils' // backcompat, consider removing in next major version
Expand Down
4 changes: 2 additions & 2 deletions src/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {StrictEqualUsingBranding} from './branding'
import {And, Extends, Not, IsAny, UsefulKeys, ExtendsExcludingAnyOrNever, IsUnknown, IsNever} from './utils'
import type {StrictEqualUsingBranding} from './branding'
import type {And, Extends, Not, IsAny, UsefulKeys, ExtendsExcludingAnyOrNever, IsUnknown, IsNever} from './utils'

/**
* Determines the printable type representation for a given type.
Expand Down
2 changes: 1 addition & 1 deletion src/overloads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {StrictEqualUsingTSInternalIdenticalToOperator, IsNever, UnionToIntersection, UnionToTuple} from './utils'
import type {StrictEqualUsingTSInternalIdenticalToOperator, IsNever, UnionToIntersection, UnionToTuple} from './utils'

// prettier-ignore
/**
Expand Down
2 changes: 1 addition & 1 deletion test/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs'
import * as fs from 'node:fs'
import {test, expect} from 'vitest'
import {tsErrors, tsFileErrors} from './ts-output'

Expand Down
2 changes: 1 addition & 1 deletion test/ts-output.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path'
import * as path from 'node:path'
import stripAnsi from 'strip-ansi'
import * as tsmorph from 'ts-morph'

Expand Down
6 changes: 3 additions & 3 deletions test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import {test} from 'vitest'
import * as a from '../src'
import {UnionToIntersection} from '../src'
import {
import * as a from '../src/index'
import type {UnionToIntersection} from '../src/index'
import type {
ConstructorOverloadParameters,
OverloadParameters,
OverloadReturnTypes,
Expand Down
2 changes: 1 addition & 1 deletion test/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint prettier/prettier: ["warn", { "singleQuote": true, "semi": false, "arrowParens": "avoid", "trailingComma": "es5", "bracketSpacing": false, "endOfLine": "auto", "printWidth": 100 }] */

import {test} from 'vitest'
import {expectTypeOf} from '../src'
import {expectTypeOf} from '../src/index'

test("Check an object's type with `.toEqualTypeOf`", () => {
expectTypeOf({a: 1}).toEqualTypeOf<{a: number}>()
Expand Down

0 comments on commit c2278a5

Please sign in to comment.