Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable 'no-duplicate-imports' #13138

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ module.exports = {
'handle-callback-err': 'off',
'id-length': 'off',
'id-match': 'off',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': [
'error',
{
Expand Down Expand Up @@ -414,6 +413,7 @@ module.exports = {
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'off',
'no-empty': 'off',
'no-empty-character-class': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions e2e/babel-plugin-jest-hoist/__tests__/importJest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*
*/

/* eslint-disable import/no-duplicates */
/* eslint-disable no-duplicate-imports */
import {jest} from '@jest/globals';
import {jest as aliasedJest} from '@jest/globals';
import * as JestGlobals from '@jest/globals';
/* eslint-enable import/no-duplicates */
/* eslint-enable no-duplicate-imports */
import a from '../__test_modules__/a';
import b from '../__test_modules__/b';
import c from '../__test_modules__/c';
Expand Down
2 changes: 0 additions & 2 deletions e2e/native-esm/__tests__/native-esm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ import staticImportedStatefulFromCjs from '../fromCjs.mjs';
import {double} from '../index';
import defaultFromCjs, {half, namedFunction} from '../namedExport.cjs';
import {bag} from '../namespaceExport.js';
/* eslint-disable import/no-duplicates */
import staticImportedStateful from '../stateful.mjs';
import staticImportedStatefulWithQuery from '../stateful.mjs?query=1';
import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2';
/* eslint-enable import/no-duplicates */

test('should have correct import.meta', () => {
expect(typeof require).toBe('undefined');
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-diff/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import chalk = require('chalk');
import {getType} from 'jest-get-type';
import {
PrettyFormatOptions,
format as prettyFormat,
plugins as prettyFormatPlugins,
} from 'pretty-format';
import type {PrettyFormatOptions} from 'pretty-format';
import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic';
import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants';
import {diffLinesRaw, diffLinesUnified, diffLinesUnified2} from './diffLines';
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-each/src/table/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import * as util from 'util';
import type {Global} from '@jest/types';
import {format as pretty} from 'pretty-format';
import type {EachTests} from '../bind';
import type {Templates} from './interpolation';
import {interpolateVariables} from './interpolation';
import {Templates, interpolateVariables} from './interpolation';

const SUPPORTED_PLACEHOLDERS = /%[sdifjoOp#]/g;
const PRETTY_PLACEHOLDER = '%p';
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-each/src/table/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

import type {Global} from '@jest/types';
import type {EachTests} from '../bind';
import type {Headings, Template, Templates} from './interpolation';
import {interpolateVariables} from './interpolation';
import {
Headings,
Template,
Templates,
interpolateVariables,
} from './interpolation';

export default function template(
title: string,
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-reporters/__typetests__/jest-reporters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*/

import {expectError, expectType} from 'tsd-lite';
import {utils} from '@jest/reporters';
import type {
import {
AggregatedResult,
Config,
SnapshotSummary,
SummaryOptions,
TestResult,
utils,
} from '@jest/reporters';

declare const aggregatedResults: AggregatedResult;
Expand Down
5 changes: 3 additions & 2 deletions packages/jest-runner/__typetests__/jest-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
*/

import {expectType} from 'tsd-lite';
import {CallbackTestRunner, EmittingTestRunner} from 'jest-runner';
import type {
import {
CallbackTestRunner,
CallbackTestRunnerInterface,
Config,
EmittingTestRunner,
EmittingTestRunnerInterface,
OnTestFailure,
OnTestStart,
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ import {
shouldInstrument,
} from '@jest/transform';
import type {Config, Global} from '@jest/types';
import type {IModuleMap} from 'jest-haste-map';
import HasteMap from 'jest-haste-map';
import HasteMap, {IModuleMap} from 'jest-haste-map';
import {formatStackTrace, separateMessageFromStack} from 'jest-message-util';
import type {MockFunctionMetadata, ModuleMocker} from 'jest-mock';
import {escapePathForRegex} from 'jest-regex-util';
Expand Down