Skip to content

Commit 812763d

Browse files
authored
chore: enable 'no-duplicate-imports' (#13138)
1 parent 7b52a2e commit 812763d

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ module.exports = {
344344
'handle-callback-err': 'off',
345345
'id-length': 'off',
346346
'id-match': 'off',
347-
'import/no-duplicates': 'error',
348347
'import/no-extraneous-dependencies': [
349348
'error',
350349
{
@@ -414,6 +413,7 @@ module.exports = {
414413
'no-dupe-class-members': 'error',
415414
'no-dupe-keys': 'error',
416415
'no-duplicate-case': 'error',
416+
'no-duplicate-imports': 'error',
417417
'no-else-return': 'off',
418418
'no-empty': 'off',
419419
'no-empty-character-class': 'warn',

e2e/babel-plugin-jest-hoist/__tests__/importJest.test.js

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

9-
/* eslint-disable import/no-duplicates */
9+
/* eslint-disable no-duplicate-imports */
1010
import {jest} from '@jest/globals';
1111
import {jest as aliasedJest} from '@jest/globals';
1212
import * as JestGlobals from '@jest/globals';
13-
/* eslint-enable import/no-duplicates */
13+
/* eslint-enable no-duplicate-imports */
1414
import a from '../__test_modules__/a';
1515
import b from '../__test_modules__/b';
1616
import c from '../__test_modules__/c';

e2e/native-esm/__tests__/native-esm.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ import staticImportedStatefulFromCjs from '../fromCjs.mjs';
1818
import {double} from '../index';
1919
import defaultFromCjs, {half, namedFunction} from '../namedExport.cjs';
2020
import {bag} from '../namespaceExport.js';
21-
/* eslint-disable import/no-duplicates */
2221
import staticImportedStateful from '../stateful.mjs';
2322
import staticImportedStatefulWithQuery from '../stateful.mjs?query=1';
2423
import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2';
25-
/* eslint-enable import/no-duplicates */
2624

2725
test('should have correct import.meta', () => {
2826
expect(typeof require).toBe('undefined');

packages/jest-diff/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import chalk = require('chalk');
99
import {getType} from 'jest-get-type';
1010
import {
11+
PrettyFormatOptions,
1112
format as prettyFormat,
1213
plugins as prettyFormatPlugins,
1314
} from 'pretty-format';
14-
import type {PrettyFormatOptions} from 'pretty-format';
1515
import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic';
1616
import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants';
1717
import {diffLinesRaw, diffLinesUnified, diffLinesUnified2} from './diffLines';

packages/jest-each/src/table/array.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import * as util from 'util';
1010
import type {Global} from '@jest/types';
1111
import {format as pretty} from 'pretty-format';
1212
import type {EachTests} from '../bind';
13-
import type {Templates} from './interpolation';
14-
import {interpolateVariables} from './interpolation';
13+
import {Templates, interpolateVariables} from './interpolation';
1514

1615
const SUPPORTED_PLACEHOLDERS = /%[sdifjoOp#]/g;
1716
const PRETTY_PLACEHOLDER = '%p';

packages/jest-each/src/table/template.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88

99
import type {Global} from '@jest/types';
1010
import type {EachTests} from '../bind';
11-
import type {Headings, Template, Templates} from './interpolation';
12-
import {interpolateVariables} from './interpolation';
11+
import {
12+
Headings,
13+
Template,
14+
Templates,
15+
interpolateVariables,
16+
} from './interpolation';
1317

1418
export default function template(
1519
title: string,

packages/jest-reporters/__typetests__/jest-reporters.test.ts

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

88
import {expectError, expectType} from 'tsd-lite';
9-
import {utils} from '@jest/reporters';
10-
import type {
9+
import {
1110
AggregatedResult,
1211
Config,
1312
SnapshotSummary,
1413
SummaryOptions,
1514
TestResult,
15+
utils,
1616
} from '@jest/reporters';
1717

1818
declare const aggregatedResults: AggregatedResult;

packages/jest-runner/__typetests__/jest-runner.test.ts

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

88
import {expectType} from 'tsd-lite';
9-
import {CallbackTestRunner, EmittingTestRunner} from 'jest-runner';
10-
import type {
9+
import {
10+
CallbackTestRunner,
1111
CallbackTestRunnerInterface,
1212
Config,
13+
EmittingTestRunner,
1314
EmittingTestRunnerInterface,
1415
OnTestFailure,
1516
OnTestStart,

packages/jest-runtime/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ import {
4848
shouldInstrument,
4949
} from '@jest/transform';
5050
import type {Config, Global} from '@jest/types';
51-
import type {IModuleMap} from 'jest-haste-map';
52-
import HasteMap from 'jest-haste-map';
51+
import HasteMap, {IModuleMap} from 'jest-haste-map';
5352
import {formatStackTrace, separateMessageFromStack} from 'jest-message-util';
5453
import type {MockFunctionMetadata, ModuleMocker} from 'jest-mock';
5554
import {escapePathForRegex} from 'jest-regex-util';

0 commit comments

Comments
 (0)