Skip to content

Commit 4a59daa

Browse files
authored
chore: use import type (#9693)
1 parent 244f7dc commit 4a59daa

File tree

220 files changed

+430
-419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+430
-419
lines changed

TestUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
// eslint-disable-next-line import/no-extraneous-dependencies
9-
import {Config} from '@jest/types';
8+
import type {Config} from '@jest/types';
109

1110
const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = {
1211
bail: 0,

e2e/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import * as fs from 'fs';
99
import * as path from 'path';
10-
import {Config} from '@jest/types';
10+
import type {Config} from '@jest/types';
1111

1212
// eslint-disable-next-line import/named
1313
import {ExecaReturnValue, sync as spawnSync} from 'execa';

e2e/babel-plugin-jest-hoist/entry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {Color} from './types';
8+
import type {Color} from './types';
99

1010
export const color: Color = 'red';

e2e/runJest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as path from 'path';
1010
import * as fs from 'fs';
1111
import {Writable} from 'stream';
1212
import execa = require('execa');
13-
import {FormattedTestResults} from '@jest/test-result';
13+
import type {FormattedTestResults} from '@jest/test-result';
1414
import stripAnsi = require('strip-ansi');
1515
import {normalizeIcons} from './Utils';
1616

packages/babel-jest/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import {createHash} from 'crypto';
99
import * as fs from 'fs';
1010
import * as path from 'path';
11-
import {Transformer} from '@jest/transform';
12-
import {Config} from '@jest/types';
11+
import type {Transformer} from '@jest/transform';
12+
import type {Config} from '@jest/types';
1313
import {
1414
PartialConfig,
1515
TransformOptions,

packages/babel-plugin-jest-hoist/src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
*
77
*/
88

9-
// Only used for types
10-
/* eslint-disable import/no-extraneous-dependencies */
11-
import {NodePath, Visitor} from '@babel/traverse';
12-
import {Identifier} from '@babel/types';
13-
/* eslint-enable */
9+
import type {NodePath, Visitor} from '@babel/traverse';
10+
import type {Identifier} from '@babel/types';
1411

1512
// We allow `jest`, `expect`, `require`, all default Node.js globals and all
1613
// ES2015 built-ins to be used inside of a `jest.mock` factory.

packages/expect/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import * as matcherUtils from 'jest-matcher-utils';
10-
import {
10+
import type {
1111
AsyncExpectationResult,
1212
Expect,
1313
ExpectationResult,

packages/expect/src/jasmineUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424

2525
/* eslint-disable */
2626

27-
import {Tester} from './types';
27+
import type {Tester} from './types';
2828

2929
// Extracted out of jasmine 2.5.2
3030
export function equals(

packages/expect/src/jestMatchersObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {AsymmetricMatcher} from './asymmetricMatchers';
10-
import {Expect, MatchersObject, SyncExpectationResult} from './types';
10+
import type {Expect, MatchersObject, SyncExpectationResult} from './types';
1111

1212
// Global matchers object holds the list of available matchers and
1313
// the state, that can hold matcher specific values that change over time.

packages/expect/src/matchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
printWithType,
2626
stringify,
2727
} from 'jest-matcher-utils';
28-
import {MatcherState, MatchersObject} from './types';
28+
import type {MatcherState, MatchersObject} from './types';
2929
import {
3030
printCloseTo,
3131
printExpectedConstructorName,

0 commit comments

Comments
 (0)