Skip to content

Commit a2218e4

Browse files
authored
Stop using import X = require('…'). (#15659)
1 parent 8fcefef commit a2218e4

File tree

128 files changed

+191
-222
lines changed

Some content is hidden

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

128 files changed

+191
-222
lines changed

babel.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ module.exports = {
1616
exclude: /react-native/,
1717
overrides: [
1818
{
19-
plugins: [
20-
require.resolve(
21-
'./scripts/babel-plugin-jest-replace-ts-require-assignment.js',
22-
),
23-
],
2419
presets: [
2520
[
2621
'@babel/preset-typescript',

e2e/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
sync as spawnSync,
1616
} from 'execa';
1717
import * as fs from 'graceful-fs';
18-
import which = require('which');
18+
import which from 'which';
1919
import type {Config} from '@jest/types';
2020

2121
const dedent = dedentBase.withOptions({escapeSpecialCharacters: true});

e2e/__tests__/jestChangedFiles.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import {tmpdir} from 'os';
99
import * as path from 'path';
1010
import * as fs from 'graceful-fs';
11-
import semver = require('semver');
12-
import slash = require('slash');
11+
import * as semver from 'semver';
12+
import slash from 'slash';
1313
import {findRepos, getChangedFilesForRoots} from 'jest-changed-files';
1414
import {
1515
cleanup,

e2e/__tests__/multipleConfigs.ts

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

88
import * as path from 'path';
9-
import slash = require('slash');
9+
import slash from 'slash';
1010
import runJest from '../runJest';
1111

1212
const MULTIPLE_CONFIGS_WARNING_TEXT = 'Multiple configurations found';

e2e/__tests__/onlyChanged.test.ts

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

88
import {tmpdir} from 'os';
99
import * as path from 'path';
10-
import semver = require('semver');
10+
import * as semver from 'semver';
1111
import {cleanup, run, testIfHg, testIfSl, writeFiles} from '../Utils';
1212
import runJest from '../runJest';
1313

e2e/__tests__/readInitialOptions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
import path = require('path');
8-
import execa = require('execa');
7+
import path from 'path';
8+
import execa from 'execa';
99
import {onNodeVersions} from '@jest/test-utils';
1010
import type {ReadJestConfigOptions, readInitialOptions} from 'jest-config';
1111

e2e/__tests__/workerForceExit.test.ts

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

88
import {tmpdir} from 'os';
99
import {resolve} from 'path';
10-
import findProcess = require('find-process');
10+
import findProcess from 'find-process';
1111
import {
1212
cleanup,
1313
generateTestFilesToForceUsingWorkers,

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 {Writable} from 'stream';
1111
import {stripVTControlCharacters as stripAnsi} from 'util';
1212
import dedent from 'dedent';
13-
import execa = require('execa');
13+
import execa from 'execa';
1414
import * as fs from 'graceful-fs';
1515
import {TestPathPatterns} from '@jest/pattern';
1616
import type {FormattedTestResults} from '@jest/test-result';

packages/babel-jest/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
transformSync as babelTransform,
1414
transformAsync as babelTransformAsync,
1515
} from '@babel/core';
16-
import chalk = require('chalk');
16+
import chalk from 'chalk';
1717
import * as fs from 'graceful-fs';
18-
import slash = require('slash');
18+
import slash from 'slash';
1919
import type {
2020
TransformOptions as JestTransformOptions,
2121
SyncTransformer,

packages/create-jest/src/runCreate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
*/
77

88
import * as path from 'path';
9-
import chalk = require('chalk');
10-
import exit = require('exit-x');
9+
import chalk from 'chalk';
10+
import exit from 'exit-x';
1111
import * as fs from 'graceful-fs';
12-
import prompts = require('prompts');
12+
import prompts from 'prompts';
1313
import {constants} from 'jest-config';
1414
import {clearLine, tryRealpath} from 'jest-util';
1515
import {MalformedPackageJsonError, NotFoundPackageJsonError} from './errors';

0 commit comments

Comments
 (0)