From 56ca4d0bf95abcb635f94bd36287308846f4fd31 Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 21 Jun 2024 16:19:03 -0400 Subject: [PATCH 1/2] chore, add back the import/order eslint rule and fix the files accordingly --- .eslintrc.js | 20 +++++++++++++++++++ e2e/harmony/deprecate.e2e.1.ts | 2 +- .../component-compare.main.runtime.ts | 2 +- .../deprecation/deprecation.main.runtime.ts | 10 +++++----- .../new-component-helper.main.runtime.ts | 2 +- .../component/remove/remove.main.runtime.ts | 2 +- .../component/snapping/tag-from-scope.cmd.ts | 2 +- scopes/defender/mocha/mocha.main.runtime.ts | 2 +- scopes/defender/mocha/mocha.tester.ts | 2 +- .../dependency-resolver/package-manager.ts | 2 +- scopes/dependencies/pnpm/lynx.ts | 18 ++++++++--------- .../dependencies/pnpm/pnpm.package-manager.ts | 6 +++--- scopes/harmony/cli/command-runner.ts | 2 +- scopes/lanes/lanes/lane.cmd.ts | 2 +- scopes/lanes/lanes/lanes.main.runtime.ts | 2 +- scopes/lanes/lanes/lanes.spec.ts | 2 +- scopes/lanes/merge-lanes/merge-lane.spec.ts | 4 ++-- scopes/lanes/merge-lanes/merge-move.cmd.ts | 2 +- scopes/react/react/react.main.runtime.ts | 2 +- .../update-dependencies.main.runtime.ts | 4 ++-- .../version-history.main.runtime.ts | 20 +++++++++---------- scopes/ui-foundation/ui/ui/client-context.tsx | 1 - scopes/workspace/watcher/output-formatter.ts | 2 +- src/api/consumer/lib/clear-cache.ts | 2 +- src/api/consumer/lib/doctor.ts | 2 +- src/consumer/consumer.ts | 2 +- 26 files changed, 69 insertions(+), 50 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f2f5b0ed5e6..687dda012de 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -79,6 +79,26 @@ module.exports = { 'prefer-object-spread': 'off', '@typescript-eslint/explicit-function-return-type': 'off', 'import/no-cycle': 'off', + 'import/order': [ + 'error', + { + groups: [ + ['builtin', 'external'], + ['internal', 'parent', 'sibling', 'index'], + ], + pathGroups: [ + { + pattern: '@teambit/**', + group: 'external', + }, + { + pattern: 'react-dev-utils/**', + group: 'external', + }, + ], + pathGroupsExcludedImportTypes: ['builtin'], + }, + ], 'import/no-useless-path-segments': 'off', 'lines-between-class-members': 'off', radix: 'off', diff --git a/e2e/harmony/deprecate.e2e.1.ts b/e2e/harmony/deprecate.e2e.1.ts index 1c30bcf658a..31114782793 100644 --- a/e2e/harmony/deprecate.e2e.1.ts +++ b/e2e/harmony/deprecate.e2e.1.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; +import { IssuesClasses } from '@teambit/component-issues'; import { Extensions } from '../../src/constants'; import Helper from '../../src/e2e-helper/e2e-helper'; -import { IssuesClasses } from '@teambit/component-issues'; describe('bit deprecate and undeprecate commands', function () { this.timeout(0); diff --git a/scopes/component/component-compare/component-compare.main.runtime.ts b/scopes/component/component-compare/component-compare.main.runtime.ts index 2afbb31feea..29cd5dbad90 100644 --- a/scopes/component/component-compare/component-compare.main.runtime.ts +++ b/scopes/component/component-compare/component-compare.main.runtime.ts @@ -24,10 +24,10 @@ import { import { diffBetweenComponentsObjects } from '@teambit/legacy/dist/consumer/component-ops/components-object-diff'; import { TesterMain, TesterAspect } from '@teambit/tester'; import { ComponentAspect, Component, ComponentMain } from '@teambit/component'; +import { ImporterAspect, ImporterMain } from '@teambit/importer'; import { componentCompareSchema } from './component-compare.graphql'; import { ComponentCompareAspect } from './component-compare.aspect'; import { DiffCmd } from './diff-cmd'; -import { ImporterAspect, ImporterMain } from '@teambit/importer'; export type ComponentCompareResult = { id: string; diff --git a/scopes/component/deprecation/deprecation.main.runtime.ts b/scopes/component/deprecation/deprecation.main.runtime.ts index df63539fd57..93f33e1ec51 100644 --- a/scopes/component/deprecation/deprecation.main.runtime.ts +++ b/scopes/component/deprecation/deprecation.main.runtime.ts @@ -5,16 +5,16 @@ import { ScopeMain, ScopeAspect } from '@teambit/scope'; import { WorkspaceAspect, Workspace } from '@teambit/workspace'; import { GraphqlAspect, GraphqlMain } from '@teambit/graphql'; import { ComponentIdObj } from '@teambit/component-id'; -import { DeprecationAspect } from './deprecation.aspect'; -import { deprecationSchema } from './deprecation.graphql'; -import { DeprecationFragment } from './deprecation.fragment'; -import { DeprecateCmd } from './deprecate-cmd'; -import { UndeprecateCmd } from './undeprecate-cmd'; import { IssuesAspect, IssuesMain } from '@teambit/issues'; import pMapSeries from 'p-map-series'; import { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver'; import { compact } from 'lodash'; import { IssuesClasses } from '@teambit/component-issues'; +import { DeprecationAspect } from './deprecation.aspect'; +import { deprecationSchema } from './deprecation.graphql'; +import { DeprecationFragment } from './deprecation.fragment'; +import { DeprecateCmd } from './deprecate-cmd'; +import { UndeprecateCmd } from './undeprecate-cmd'; export type DeprecationInfo = { isDeprecate: boolean; diff --git a/scopes/component/new-component-helper/new-component-helper.main.runtime.ts b/scopes/component/new-component-helper/new-component-helper.main.runtime.ts index e0bbff1396e..57fce87b628 100644 --- a/scopes/component/new-component-helper/new-component-helper.main.runtime.ts +++ b/scopes/component/new-component-helper/new-component-helper.main.runtime.ts @@ -13,8 +13,8 @@ import { WorkspaceAspect, Workspace } from '@teambit/workspace'; import { PkgAspect } from '@teambit/pkg'; import { RenamingAspect } from '@teambit/renaming'; import { EnvsAspect } from '@teambit/envs'; -import { NewComponentHelperAspect } from './new-component-helper.aspect'; import { incrementPathRecursively } from '@teambit/component-writer'; +import { NewComponentHelperAspect } from './new-component-helper.aspect'; const aspectsConfigToIgnore: string[] = [PkgAspect.id, RenamingAspect.id]; diff --git a/scopes/component/remove/remove.main.runtime.ts b/scopes/component/remove/remove.main.runtime.ts index 93aef297a79..472f1ff8337 100644 --- a/scopes/component/remove/remove.main.runtime.ts +++ b/scopes/component/remove/remove.main.runtime.ts @@ -17,13 +17,13 @@ import pMapSeries from 'p-map-series'; import { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version'; import { ComponentAspect, Component, ComponentMain } from '@teambit/component'; import { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils'; +import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { RemoveCmd } from './remove-cmd'; import { RemoveComponentsResult, removeComponents } from './remove-components'; import { RemoveAspect } from './remove.aspect'; import { RemoveFragment } from './remove.fragment'; import { RecoverCmd, RecoverOptions } from './recover-cmd'; import { DeleteCmd } from './delete-cmd'; -import { ScopeAspect, ScopeMain } from '@teambit/scope'; const BEFORE_REMOVE = 'removing components'; diff --git a/scopes/component/snapping/tag-from-scope.cmd.ts b/scopes/component/snapping/tag-from-scope.cmd.ts index f3cf0cb7cca..aa726cebdab 100644 --- a/scopes/component/snapping/tag-from-scope.cmd.ts +++ b/scopes/component/snapping/tag-from-scope.cmd.ts @@ -1,12 +1,12 @@ import chalk from 'chalk'; import { Command, CommandOptions } from '@teambit/cli'; -import { NOTHING_TO_TAG_MSG, AUTO_TAGGED_MSG } from './tag-cmd'; import { DEFAULT_BIT_RELEASE_TYPE } from '@teambit/legacy/dist/constants'; import { getHarmonyVersion } from '@teambit/legacy/dist/bootstrap'; import { IssuesClasses } from '@teambit/component-issues'; import { ReleaseType } from 'semver'; import { BitError } from '@teambit/bit-error'; import { Logger } from '@teambit/logger'; +import { NOTHING_TO_TAG_MSG, AUTO_TAGGED_MSG } from './tag-cmd'; import { SnappingMain, TagResults } from './snapping.main.runtime'; import { BasicTagParams } from './tag-model-component'; diff --git a/scopes/defender/mocha/mocha.main.runtime.ts b/scopes/defender/mocha/mocha.main.runtime.ts index 26f2809eb5b..8a7488d21f5 100644 --- a/scopes/defender/mocha/mocha.main.runtime.ts +++ b/scopes/defender/mocha/mocha.main.runtime.ts @@ -1,7 +1,7 @@ import { MainRuntime } from '@teambit/cli'; import type { TransformOptions } from '@babel/core'; -import type Mocha from 'mocha'; import { Logger, LoggerAspect, LoggerMain } from '@teambit/logger'; +import type Mocha from 'mocha'; import { MochaAspect } from './mocha.aspect'; import { MochaTester } from './mocha.tester'; diff --git a/scopes/defender/mocha/mocha.tester.ts b/scopes/defender/mocha/mocha.tester.ts index 42d3e3e8859..1e9bf5b12dd 100644 --- a/scopes/defender/mocha/mocha.tester.ts +++ b/scopes/defender/mocha/mocha.tester.ts @@ -1,12 +1,12 @@ import { Logger } from '@teambit/logger'; import { ComponentsResults, Tester, CallbackFn, TesterContext, Tests } from '@teambit/tester'; -import Mocha, { Test } from 'mocha'; import babelRegister from '@babel/register'; import type { TransformOptions } from '@babel/core'; import { TestResult, TestsFiles, TestsResult } from '@teambit/tests-results'; import pMapSeries from 'p-map-series'; import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources'; import { compact } from 'lodash'; +import Mocha, { Test } from 'mocha'; export class MochaTester implements Tester { _callback: CallbackFn | undefined; diff --git a/scopes/dependencies/dependency-resolver/package-manager.ts b/scopes/dependencies/dependency-resolver/package-manager.ts index 6f14a5d2594..3db89ffdc35 100644 --- a/scopes/dependencies/dependency-resolver/package-manager.ts +++ b/scopes/dependencies/dependency-resolver/package-manager.ts @@ -1,6 +1,6 @@ -import { PeerDependencyIssuesByProjects } from '@pnpm/core'; import { PeerDependencyRules, ProjectManifest } from '@pnpm/types'; import { ComponentMap } from '@teambit/component'; +import { PeerDependencyIssuesByProjects } from '@pnpm/core'; import { Registries } from './registry'; import { DepsFilterFn } from './manifest'; import { NetworkConfig, ProxyConfig } from './dependency-resolver.main.runtime'; diff --git a/scopes/dependencies/pnpm/lynx.ts b/scopes/dependencies/pnpm/lynx.ts index 96f99708cf2..835480b8038 100644 --- a/scopes/dependencies/pnpm/lynx.ts +++ b/scopes/dependencies/pnpm/lynx.ts @@ -16,22 +16,22 @@ import { PackageManagerNetworkConfig, } from '@teambit/dependency-resolver'; import { BitError } from '@teambit/bit-error'; -import { - MutatedProject, - mutateModules, - InstallOptions, - PeerDependencyIssuesByProjects, - ProjectOptions, -} from '@pnpm/core'; -import * as pnpm from '@pnpm/core'; import { createClient, ClientOptions } from '@pnpm/client'; import { pickRegistryForPackage } from '@pnpm/pick-registry-for-package'; import { restartWorkerPool, finishWorkers } from '@pnpm/worker'; import { createPkgGraph } from '@pnpm/workspace.pkgs-graph'; import { PackageManifest, ProjectManifest, ReadPackageHook } from '@pnpm/types'; import { Logger } from '@teambit/logger'; -import { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path' +import { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path'; import toNerfDart from 'nerf-dart'; +import * as pnpm from '@pnpm/core'; +import { + MutatedProject, + mutateModules, + InstallOptions, + PeerDependencyIssuesByProjects, + ProjectOptions, +} from '@pnpm/core'; import { pnpmErrorToBitError } from './pnpm-error-to-bit-error'; import { readConfig } from './read-config'; diff --git a/scopes/dependencies/pnpm/pnpm.package-manager.ts b/scopes/dependencies/pnpm/pnpm.package-manager.ts index deaf40cf961..2951455f080 100644 --- a/scopes/dependencies/pnpm/pnpm.package-manager.ts +++ b/scopes/dependencies/pnpm/pnpm.package-manager.ts @@ -13,11 +13,10 @@ import { PackageManagerProxyConfig, PackageManagerNetworkConfig, } from '@teambit/dependency-resolver'; -import { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path' +import { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path'; import { Logger } from '@teambit/logger'; import fs from 'fs'; import { memoize, omit } from 'lodash'; -import { PeerDependencyIssuesByProjects } from '@pnpm/core'; import { readModulesManifest, Modules } from '@pnpm/modules-yaml'; import { buildDependenciesHierarchy, @@ -29,11 +28,12 @@ import { renderTree } from '@pnpm/list'; import { readWantedLockfile } from '@pnpm/lockfile-file'; import { ProjectManifest } from '@pnpm/types'; import { join } from 'path'; +import { PeerDependencyIssuesByProjects } from '@pnpm/core'; import { readConfig } from './read-config'; import { pnpmPruneModules } from './pnpm-prune-modules'; import type { RebuildFn } from './lynx'; -export type { RebuildFn } +export type { RebuildFn }; export interface InstallResult { dependenciesChanged: boolean; diff --git a/scopes/harmony/cli/command-runner.ts b/scopes/harmony/cli/command-runner.ts index 0affa10e41f..2dbdcdd2bf0 100644 --- a/scopes/harmony/cli/command-runner.ts +++ b/scopes/harmony/cli/command-runner.ts @@ -6,8 +6,8 @@ import { handleErrorAndExit } from '@teambit/legacy/dist/cli/handle-errors'; import { TOKEN_FLAG_NAME } from '@teambit/legacy/dist/constants'; import globalFlags from '@teambit/legacy/dist/cli/global-flags'; import { Analytics } from '@teambit/legacy/dist/analytics/analytics'; -import { OnCommandStartSlot } from './cli.main.runtime'; import pMapSeries from 'p-map-series'; +import { OnCommandStartSlot } from './cli.main.runtime'; export class CommandRunner { private commandName: string; diff --git a/scopes/lanes/lanes/lane.cmd.ts b/scopes/lanes/lanes/lane.cmd.ts index a98d3990da6..a13550a95f2 100644 --- a/scopes/lanes/lanes/lane.cmd.ts +++ b/scopes/lanes/lanes/lane.cmd.ts @@ -10,9 +10,9 @@ import { LaneData, serializeLaneData } from '@teambit/legacy/dist/scope/lanes/la import { BitError } from '@teambit/bit-error'; import { approveOperation } from '@teambit/legacy/dist/prompts'; import { COMPONENT_PATTERN_HELP, DEFAULT_CLOUD_DOMAIN } from '@teambit/legacy/dist/constants'; +import { FetchCmd } from '@teambit/importer'; import { CreateLaneOptions, LanesMain } from './lanes.main.runtime'; import { SwitchCmd } from './switch.cmd'; -import { FetchCmd } from '@teambit/importer'; type LaneOptions = { details?: boolean; diff --git a/scopes/lanes/lanes/lanes.main.runtime.ts b/scopes/lanes/lanes/lanes.main.runtime.ts index 63b5e122d51..4bc4feeaa88 100644 --- a/scopes/lanes/lanes/lanes.main.runtime.ts +++ b/scopes/lanes/lanes/lanes.main.runtime.ts @@ -37,6 +37,7 @@ import ComponentsList, { DivergeDataPerId } from '@teambit/legacy/dist/consumer/ import { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap'; import { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency'; import { SUPPORT_LANE_HISTORY, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle'; +import { InstallAspect, InstallMain } from '@teambit/install'; import { LanesAspect } from './lanes.aspect'; import { LaneCmd, @@ -66,7 +67,6 @@ import { createLane, createLaneInScope, throwForInvalidLaneName } from './create import { LanesCreateRoute } from './lanes.create.route'; import { LanesDeleteRoute } from './lanes.delete.route'; import { LanesRestoreRoute } from './lanes.restore.route'; -import { InstallAspect, InstallMain } from '@teambit/install'; export { Lane }; diff --git a/scopes/lanes/lanes/lanes.spec.ts b/scopes/lanes/lanes/lanes.spec.ts index ca87528eb40..1efa170be21 100644 --- a/scopes/lanes/lanes/lanes.spec.ts +++ b/scopes/lanes/lanes/lanes.spec.ts @@ -12,9 +12,9 @@ import { SUPPORT_LANE_HISTORY, addFeature, removeFeature } from '@teambit/legacy import { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace'; import { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components'; import { ChangeType } from '@teambit/lanes.entities.lane-diff'; +import { MergeLanesAspect, MergeLanesMain } from '@teambit/merge-lanes'; import { LanesAspect } from './lanes.aspect'; import { LanesMain } from './lanes.main.runtime'; -import { MergeLanesAspect, MergeLanesMain } from '@teambit/merge-lanes'; describe('LanesAspect', function () { this.timeout(0); diff --git a/scopes/lanes/merge-lanes/merge-lane.spec.ts b/scopes/lanes/merge-lanes/merge-lane.spec.ts index 51d07010d8f..12f76825153 100644 --- a/scopes/lanes/merge-lanes/merge-lane.spec.ts +++ b/scopes/lanes/merge-lanes/merge-lane.spec.ts @@ -10,10 +10,10 @@ import { import { ScopeAspect } from '@teambit/scope'; import { ExportAspect, ExportMain } from '@teambit/export'; import { mockComponents } from '@teambit/component.testing.mock-components'; -import { MergeLanesAspect } from './merge-lanes.aspect'; -import { MergeFromScopeResult, MergeLanesMain } from './merge-lanes.main.runtime'; import { LanesAspect, LanesMain } from '@teambit/lanes'; import { SnappingAspect, SnappingMain } from '@teambit/snapping'; +import { MergeLanesAspect } from './merge-lanes.aspect'; +import { MergeFromScopeResult, MergeLanesMain } from './merge-lanes.main.runtime'; describe('MergeLane aspect', function () { this.timeout(0); diff --git a/scopes/lanes/merge-lanes/merge-move.cmd.ts b/scopes/lanes/merge-lanes/merge-move.cmd.ts index b807cee6514..3b3acca7615 100644 --- a/scopes/lanes/merge-lanes/merge-move.cmd.ts +++ b/scopes/lanes/merge-lanes/merge-move.cmd.ts @@ -1,7 +1,7 @@ import chalk from 'chalk'; import { Command, CommandOptions } from '@teambit/cli'; -import { MergeLanesMain } from './merge-lanes.main.runtime'; import { BitError } from '@teambit/bit-error'; +import { MergeLanesMain } from './merge-lanes.main.runtime'; export type MergeAbortOpts = { silent?: boolean; // don't show prompt before aborting diff --git a/scopes/react/react/react.main.runtime.ts b/scopes/react/react/react.main.runtime.ts index 99c492a6f65..d38f9a2524e 100644 --- a/scopes/react/react/react.main.runtime.ts +++ b/scopes/react/react/react.main.runtime.ts @@ -31,6 +31,7 @@ import { Logger, LoggerAspect, LoggerMain } from '@teambit/logger'; import { EslintConfigTransformer } from '@teambit/defender.eslint.config-mutator'; import { WorkerAspect, WorkerMain } from '@teambit/worker'; +import { PrettierConfigTransformer } from '@teambit/defender.prettier.config-mutator'; import { ReactAspect } from './react.aspect'; import { ReactEnv } from './react.env'; import { ReactAppType } from './apps/web'; @@ -39,7 +40,6 @@ import { getTemplates } from './react.templates'; import { ReactAppOptions } from './apps/web/react-app-options'; import { ReactSchema } from './react.schema'; import { ReactAPITransformer } from './react.api.transformer'; -import { PrettierConfigTransformer } from '@teambit/defender.prettier.config-mutator'; type ReactDeps = [ EnvsMain, diff --git a/scopes/scope/update-dependencies/update-dependencies.main.runtime.ts b/scopes/scope/update-dependencies/update-dependencies.main.runtime.ts index 490ae23a3b4..d8d4866632a 100644 --- a/scopes/scope/update-dependencies/update-dependencies.main.runtime.ts +++ b/scopes/scope/update-dependencies/update-dependencies.main.runtime.ts @@ -16,10 +16,10 @@ import { DependencyResolverAspect, DependencyResolverMain } from '@teambit/depen import { ExportAspect, ExportMain } from '@teambit/export'; import { LanesAspect, Lane, LanesMain } from '@teambit/lanes'; import { ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config'; -import { UpdateDependenciesCmd } from './update-dependencies.cmd'; -import { UpdateDependenciesAspect } from './update-dependencies.aspect'; import { Ref } from '@teambit/legacy/dist/scope/objects'; import { isSnap } from '@teambit/component-version'; +import { UpdateDependenciesCmd } from './update-dependencies.cmd'; +import { UpdateDependenciesAspect } from './update-dependencies.aspect'; export type UpdateDepsOptions = { tag?: boolean; diff --git a/scopes/scope/version-history/version-history.main.runtime.ts b/scopes/scope/version-history/version-history.main.runtime.ts index e1b4736df38..a81ee8c57bf 100644 --- a/scopes/scope/version-history/version-history.main.runtime.ts +++ b/scopes/scope/version-history/version-history.main.runtime.ts @@ -1,25 +1,25 @@ import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli'; import getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name'; import { loadConsumerIfExist } from '@teambit/legacy/dist/consumer'; -import { VersionHistoryAspect } from './version-history.aspect'; -import { - BuildOptions, - ShowOptions, - VersionHistoryBuildCmd, - VersionHistoryCmd, - VersionHistoryGraphCmd, - VersionHistoryShowCmd, -} from './version-history-cmd'; import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { ComponentID, ComponentIdList } from '@teambit/component-id'; import { BitError } from '@teambit/bit-error'; import { ModelComponent, VersionHistory } from '@teambit/legacy/dist/scope/models'; import { Ref } from '@teambit/legacy/dist/scope/objects'; import { ExternalActions } from '@teambit/legacy/dist/api/scope/lib/action'; -import { BuildVersionHistoryAction } from './build-version-history-action'; import { Logger, LoggerAspect, LoggerMain } from '@teambit/logger'; import { compact } from 'lodash'; import { VersionHistoryGraph } from '@teambit/legacy/dist/scope/models/version-history'; +import { BuildVersionHistoryAction } from './build-version-history-action'; +import { + BuildOptions, + ShowOptions, + VersionHistoryBuildCmd, + VersionHistoryCmd, + VersionHistoryGraphCmd, + VersionHistoryShowCmd, +} from './version-history-cmd'; +import { VersionHistoryAspect } from './version-history.aspect'; type BuildResult = { err?: Error; added?: string[] }; type ShowResult = { node: string; pointers: string[]; edges: Array<{ hash: string; type: string }> }; diff --git a/scopes/ui-foundation/ui/ui/client-context.tsx b/scopes/ui-foundation/ui/ui/client-context.tsx index fef6bf89e5d..2a9c33da557 100644 --- a/scopes/ui-foundation/ui/ui/client-context.tsx +++ b/scopes/ui-foundation/ui/ui/client-context.tsx @@ -5,7 +5,6 @@ import { IconFont } from '@teambit/design.theme.icons-font'; import { LoaderRibbon } from '@teambit/base-ui.loaders.loader-ribbon'; import { Roboto } from '@teambit/base-ui.theme.fonts.roboto'; import { TooltipMountPoint } from '@teambit/design.ui.tooltip'; - import { LoaderContext, useLoaderApi } from '@teambit/ui-foundation.ui.global-loader'; import styles from './client-context.module.scss'; diff --git a/scopes/workspace/watcher/output-formatter.ts b/scopes/workspace/watcher/output-formatter.ts index be7a2bfb6b2..3aefea12447 100644 --- a/scopes/workspace/watcher/output-formatter.ts +++ b/scopes/workspace/watcher/output-formatter.ts @@ -2,8 +2,8 @@ import { Logger } from '@teambit/logger'; import { CompilerAspect } from '@teambit/compiler'; import { OnComponentEventResult } from '@teambit/workspace'; import chalk from 'chalk'; -import { RootDirs } from './watcher'; import { compact } from 'lodash'; +import { RootDirs } from './watcher'; export function formatWatchPathsSortByComponent(trackDirs: RootDirs) { const title = ` ${chalk.underline('STATUS\tCOMPONENT ID')}\n`; diff --git a/src/api/consumer/lib/clear-cache.ts b/src/api/consumer/lib/clear-cache.ts index cf2e0b48177..71d3dd137d9 100644 --- a/src/api/consumer/lib/clear-cache.ts +++ b/src/api/consumer/lib/clear-cache.ts @@ -1,9 +1,9 @@ import fs from 'fs-extra'; // it's a hack, but I didn't find a better way to access the getCacheDir() function import { __TEST__ as v8CompileCache } from 'v8-compile-cache'; +import { findScopePath } from '@teambit/scope.modules.find-scope-path'; import { Consumer, getConsumerInfo, loadConsumerIfExist } from '../../../consumer'; import { ComponentFsCache } from '../../../consumer/component/component-fs-cache'; -import { findScopePath } from '@teambit/scope.modules.find-scope-path'; import ScopeIndex from '../../../scope/objects/scope-index'; export type CacheClearResult = { succeed: string[]; failed: string[] }; diff --git a/src/api/consumer/lib/doctor.ts b/src/api/consumer/lib/doctor.ts index 95ac081a118..c4ca7aba795 100644 --- a/src/api/consumer/lib/doctor.ts +++ b/src/api/consumer/lib/doctor.ts @@ -5,6 +5,7 @@ import Stream from 'stream'; import path from 'path'; import tar from 'tar-stream'; import tarFS from 'tar-fs'; +import { findScopePath } from '@teambit/scope.modules.find-scope-path'; import { getHarmonyVersion } from '../../../bootstrap'; import { CFG_USER_EMAIL_KEY, CFG_USER_NAME_KEY, DEBUG_LOG } from '../../../constants'; import BitMap from '../../../consumer/bit-map'; @@ -15,7 +16,6 @@ import DoctorRegistrar from '../../../doctor/doctor-registrar'; import registerCoreAndExtensionsDiagnoses from '../../../doctor/doctor-registrar-builder'; import logger from '../../../logger/logger'; import { getExt, getWithoutExt, removeChalkCharacters } from '../../../utils'; -import { findScopePath } from '@teambit/scope.modules.find-scope-path'; import DiagnosisNotFound from './exceptions/diagnosis-not-found'; import MissingDiagnosisName from './exceptions/missing-diagnosis-name'; diff --git a/src/consumer/consumer.ts b/src/consumer/consumer.ts index 71fd73741af..92e04f43cdd 100644 --- a/src/consumer/consumer.ts +++ b/src/consumer/consumer.ts @@ -6,6 +6,7 @@ import { ComponentID, ComponentIdList } from '@teambit/component-id'; import { DEFAULT_LANE, LaneId } from '@teambit/lane-id'; import { BitIdStr } from '@teambit/legacy-bit-id'; import { BitError } from '@teambit/bit-error'; +import { sortObjectByKeys } from '@teambit/toolbox.object.sorter'; import { Analytics } from '../analytics/analytics'; import { BIT_GIT_DIR, @@ -21,7 +22,6 @@ import { getAutoTagPending } from '../scope/component-ops/auto-tag'; import { ComponentNotFound } from '../scope/exceptions'; import { Lane, ModelComponent, Version } from '../scope/models'; // import { generateRandomStr } from '@teambit/toolbox.string.random'; -import { sortObjectByKeys } from '@teambit/toolbox.object.sorter'; import { composeComponentPath } from '../utils/bit/compose-component-path'; import { PathAbsolute, From a0e6dd455c55bfaa1a321b12c5720c71889d1b9c Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 21 Jun 2024 17:07:53 -0400 Subject: [PATCH 2/2] fix lint --- .eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 687dda012de..3356af29f10 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,6 +95,10 @@ module.exports = { pattern: 'react-dev-utils/**', group: 'external', }, + { + pattern: '@{*,**}', + group: 'external', + }, ], pathGroupsExcludedImportTypes: ['builtin'], },