Skip to content
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: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const config = {
rules: {
'@typescript-eslint/consistent-generic-constructors': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/naming-convention': [
'error',
Expand Down
7 changes: 7 additions & 0 deletions change/beachball-41e15715-39f5-4e08-b9fb-15190803a8af.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use `import type` internally",
"packageName": "beachball",
"email": "elcraig@microsoft.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions src/__e2e__/change.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ let mockBeachballOptions: Partial<BeachballOptions> | undefined;
jest.mock('../options/getDefaultOptions', () => ({
getDefaultOptions: () => ({
...jest
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
.requireActual<typeof import('../options/getDefaultOptions')>('../options/getDefaultOptions')
.getDefaultOptions(),
...mockBeachballOptions,
Expand Down
5 changes: 3 additions & 2 deletions src/__fixtures__/mockNpm.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { afterAll, afterEach, beforeAll, jest } from '@jest/globals';
import type { jest } from '@jest/globals';
import { afterAll, afterEach, beforeAll } from '@jest/globals';
import fs from 'fs';
import fetch from 'npm-registry-fetch';
import path from 'path';
import semver from 'semver';
import { npm, NpmResult } from '../packageManager/npm';
import { npm, type NpmResult } from '../packageManager/npm';
import type { PackageJson } from '../types/PackageInfo';
import type { PackageManagerOptions } from '../packageManager/packageManager';
import { readJson } from '../object/readJson';
Expand Down
4 changes: 2 additions & 2 deletions src/__functional__/packageManager/packPackage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import fs from 'fs';
import path from 'path';
import { initMockLogs } from '../../__fixtures__/mockLogs';
import { removeTempDir, tmpdir } from '../../__fixtures__/tmpdir';
import * as npmModuleType from '../../packageManager/npm';
import type * as npmModuleType from '../../packageManager/npm';
import type { NpmResult } from '../../packageManager/npm';
import { packPackage } from '../../packageManager/packPackage';
import { PackageInfo } from '../../types/PackageInfo';
import type { PackageInfo } from '../../types/PackageInfo';
import { getMockNpmPackName, initNpmMock } from '../../__fixtures__/mockNpm';
import { writeJson } from '../../object/writeJson';

Expand Down
2 changes: 1 addition & 1 deletion src/__functional__/packageManager/packagePublish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { removeTempDir, tmpdir } from '../../__fixtures__/tmpdir';
import * as npmModule from '../../packageManager/npm';
import { packagePublish } from '../../packageManager/packagePublish';
import type { PackageInfo } from '../../types/PackageInfo';
import { npm, NpmResult } from '../../packageManager/npm';
import type { npm, NpmResult } from '../../packageManager/npm';
import { writeJson } from '../../object/writeJson';
import { getNpmPackageInfo, type NpmPackageVersionsData } from '../../packageManager/getNpmPackageInfo';
import { env } from '../../env';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/bump/performBump.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makePackageInfos, type PartialPackageInfos } from '../../__fixtures__/p
import type { BumpInfo } from '../../types/BumpInfo';
import { getParsedOptions } from '../../options/getOptions';
import { performBump } from '../../bump/performBump';
import { ChangeSet, type ChangeFileInfo } from '../../types/ChangeInfo';
import type { ChangeSet, ChangeFileInfo } from '../../types/ChangeInfo';
import { consideredDependencies, type PackageInfos, type PackageJson } from '../../types/PackageInfo';
import { initMockLogs } from '../../__fixtures__/mockLogs';
import { updateLockFile as _updateLockFile } from '../../bump/updateLockFile';
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/bump/updateLockFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jest.mock('fs');
jest.mock('../../packageManager/packageManager');
jest.mock('../../env', () => ({
env: {
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
...jest.requireActual<typeof import('../../env')>('../../env').env,
isJest: false,
},
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/bump/updateRelatedChangeType.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from '@jest/globals';
import { updateRelatedChangeType } from '../../bump/updateRelatedChangeType';
import type { ChangeFileInfo, ChangeInfo, ChangeType } from '../../types/ChangeInfo';
import { PartialPackageInfos, makePackageInfos } from '../../__fixtures__/packageInfos';
import { PackageGroups } from '../../types/PackageInfo';
import { makePackageInfos, type PartialPackageInfos } from '../../__fixtures__/packageInfos';
import type { PackageGroups } from '../../types/PackageInfo';
import { getDependentsForPackages } from '../../bump/getDependentsForPackages';
import type { BeachballOptions } from '../../types/BeachballOptions';

Expand Down
2 changes: 1 addition & 1 deletion src/bump/updateRelatedChangeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getMaxChangeType } from '../changefile/changeTypes';
import { getPackageOption } from '../options/getPackageOption';
import type { BeachballOptions } from '../types/BeachballOptions';
import type { BumpInfo, PackageDependents } from '../types/BumpInfo';
import { ChangeFileInfo } from '../types/ChangeInfo';
import type { ChangeFileInfo } from '../types/ChangeInfo';

/**
* This is the core of the `bumpInfo` dependency bumping logic - done once per change info.
Expand Down
2 changes: 1 addition & 1 deletion src/changefile/changeTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BumpInfo } from '../types/BumpInfo';
import type { BumpInfo } from '../types/BumpInfo';
import type { ChangeSet, ChangeType } from '../types/ChangeInfo';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/packageManager/packPackage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import path from 'path';
import { PackageInfo } from '../types/PackageInfo';
import { BeachballOptions } from '../types/BeachballOptions';
import type { PackageInfo } from '../types/PackageInfo';
import type { BeachballOptions } from '../types/BeachballOptions';
import { npm } from './npm';
import { getNpmLogLevelArgs } from './npmArgs';

Expand Down
2 changes: 1 addition & 1 deletion src/validation/isValidDependentChangeType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SortedChangeTypes } from '../changefile/changeTypes';
import { ChangeType } from '../types/ChangeInfo';
import type { ChangeType } from '../types/ChangeInfo';

/**
* Returns whether `dependentChangeType` is valid and not disallowed.
Expand Down