Skip to content

Commit

Permalink
build: Manually apply lint fixups for import/order (microsoft#20374)
Browse files Browse the repository at this point in the history
We are updating the settings for the import/order lint rule in microsoft#20363,
so I pre-applied many of the changes from the new settings using the
following command:

```shell
pnpm flub exec -g client --concurrency 7 -- 'eslint --fix --fix-type problem,suggestion,layout --rule '"'"'"import/order": ["error", {"newlines-between": "always", "alphabetize": {"order": "asc", "caseInsensitive": false }}]'"'"' src'
```

Note the rule settings used:

```json
"import/order": ["error", {"newlines-between": "always", "alphabetize": {"order": "asc", "caseInsensitive": false }}]
```

I used **case-sensitive sorting** since that's closest to what we
currently have.

I did need to do some manual cleanup in tree and devtools-view just to
re-arrange some lint disables.
  • Loading branch information
tylerbutler authored Mar 28, 2024
1 parent 14314df commit 6e6ee6d
Show file tree
Hide file tree
Showing 1,473 changed files with 2,348 additions and 442 deletions.
3 changes: 1 addition & 2 deletions azure/packages/azure-service-utils/src/generateToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
* Licensed under the MIT License.
*/

import type { ITokenClaims, IUser, ScopeType } from "@fluidframework/protocol-definitions";
import { KJUR as jsrsasign } from "jsrsasign";
import { v4 as uuid } from "uuid";

import type { ITokenClaims, IUser, ScopeType } from "@fluidframework/protocol-definitions";

/**
* IMPORTANT: This function is duplicated in ./packages/runtime/test-runtime-utils/src/generateToken.ts. There is no
* need for different implementations, so they should be kept in sync if changes are needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { ChildProcess } from "child_process";

import { ConnectionState } from "@fluidframework/container-loader";
import { IFluidContainer } from "@fluidframework/fluid-static";
import { PerformanceEvent } from "@fluidframework/telemetry-utils";
Expand Down
1 change: 1 addition & 0 deletions azure/packages/test/scenario-runner/src/ScenarioRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { ChildProcess } from "child_process";

import { TypedEventEmitter } from "@fluid-internal/client-utils";
import { delay } from "@fluidframework/core-utils";

Expand Down
3 changes: 1 addition & 2 deletions azure/packages/test/scenario-runner/src/TestOrchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
import * as fs from "node:fs";
import path from "node:path";

import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";
import * as yaml from "js-yaml";
import { v4 as uuid } from "uuid";

import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";

import { AzureClientRunner, AzureClientRunnerConfig } from "./AzureClientRunner.js";
import { DocCreatorRunner, DocCreatorRunnerConfig } from "./DocCreatorRunner.js";
import { DocLoaderRunner, DocLoaderRunnerConfig } from "./DocLoaderRunner.js";
Expand Down
3 changes: 2 additions & 1 deletion azure/packages/test/scenario-runner/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import child_process from "child_process";

import {
AzureClient,
// eslint-disable-next-line import/no-deprecated
Expand All @@ -15,11 +16,11 @@ import {
} from "@fluidframework/azure-client";
import { ContainerSchema } from "@fluidframework/fluid-static";
import { SharedMap } from "@fluidframework/map";
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
import { InsecureTokenProvider } from "@fluidframework/test-runtime-utils";
import commander from "commander";
import { v4 as uuid } from "uuid";

import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
import { AzureClientConnectionConfig, ContainerFactorySchema, IRunConfig } from "./interface.js";

export interface AzureClientConfig {
Expand Down
1 change: 1 addition & 0 deletions examples/apps/attributable-map/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { StaticCodeLoader, TinyliciousModelLoader } from "@fluid-example/example-utils";
import { enableOnNewFileKey } from "@fluid-experimental/attributor";

import { HitCounterContainerRuntimeFactory, IHitCounterAppModel } from "./containerCode.js";
import { renderHitCounter } from "./view.js";

Expand Down
1 change: 1 addition & 0 deletions examples/apps/attributable-map/src/containerCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { IProvideRuntimeAttributor, IRuntimeAttributor } from "@fluid-experiment
import { IContainer } from "@fluidframework/container-definitions";
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
import { FluidObject } from "@fluidframework/core-interfaces";

import { HitCounter } from "./dataObject.js";
import { ModelContainerRuntimeFactoryWithAttribution } from "./modelContainerRuntimeFactoryWithAttribution.js";

Expand Down
1 change: 1 addition & 0 deletions examples/apps/attributable-map/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { IRuntimeAttributor } from "@fluid-experimental/attributor";

import { IHitCounter, ITinyliciousUser, greenKey, redKey } from "./dataObject.js";

export function renderHitCounter(
Expand Down
1 change: 0 additions & 1 deletion examples/apps/data-object-grid/src/dataObjectGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import type { EventEmitter } from "@fluid-example/example-utils";
import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct";
import { Serializable } from "@fluidframework/datastore-definitions";

import { Layout } from "react-grid-layout";
import { v4 as uuid } from "uuid";

Expand Down
1 change: 1 addition & 0 deletions examples/apps/data-object-grid/src/dataObjectGridView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import React from "react";
import RGL, { WidthProvider, Layout } from "react-grid-layout";

import { IDataObjectGrid, IDataObjectGridItem } from "./dataObjectGrid.js";
import { IDataObjectGridItemEntry, dataObjectRegistry } from "./dataObjectRegistry.js";
import { DataObjectGridToolbar } from "./toolbar.js";
Expand Down
1 change: 0 additions & 1 deletion examples/apps/data-object-grid/src/dataObjectRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
IFluidDataStoreFactory,
NamedFluidDataStoreRegistryEntries,
} from "@fluidframework/runtime-definitions";

import * as React from "react";

const codeMirrorFactory = new SmdeFactory();
Expand Down
1 change: 1 addition & 0 deletions examples/apps/data-object-grid/src/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { Button } from "@fluentui/react-components";
import { ChevronDownFilled, ChevronUpFilled, TargetEditFilled } from "@fluentui/react-icons";
import React from "react";

import { Collapsible } from "./collapsible.cjs";
import { IDataObjectGridItemEntry } from "./dataObjectRegistry.js";
import { iconMap } from "./icons.js";
Expand Down
1 change: 1 addition & 0 deletions examples/apps/presence-tracker/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { StaticCodeLoader, TinyliciousModelLoader } from "@fluid-example/example-utils";

import { ITrackerAppModel, TrackerContainerRuntimeFactory } from "./containerCode.js";
import { renderFocusPresence, renderMousePresence } from "./view.js";

Expand Down
1 change: 1 addition & 0 deletions examples/apps/presence-tracker/src/containerCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Signaler } from "@fluid-experimental/data-objects";
import { IContainer } from "@fluidframework/container-definitions";
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
import { createServiceAudience } from "@fluidframework/fluid-static";

import { createMockServiceMember } from "./Audience.js";
import { FocusTracker } from "./FocusTracker.js";
import { MouseTracker } from "./MouseTracker.js";
Expand Down
1 change: 1 addition & 0 deletions examples/apps/tree-comparison/src/model/containerCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { IContainer } from "@fluidframework/container-definitions";
import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions";

import type { IInventoryList, IInventoryListAppModel } from "../modelInterfaces.js";

import { InventoryListAppModel } from "./appModel.js";
import { LegacyTreeInventoryListFactory } from "./legacyTreeInventoryList.js";
import { NewTreeInventoryListFactory } from "./newTreeInventoryList.js";
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/tree-comparison/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License.
*/

import { StaticCodeLoader, TinyliciousModelLoader } from "@fluid-example/example-utils";
import React from "react";
import ReactDOM from "react-dom";

import { StaticCodeLoader, TinyliciousModelLoader } from "@fluid-example/example-utils";
import { InventoryListContainerRuntimeFactory } from "./model/index.js";
import type { IInventoryListAppModel } from "./modelInterfaces.js";
import { DebugView, InventoryListAppView } from "./view/index.js";
Expand Down
1 change: 1 addition & 0 deletions examples/apps/tree-comparison/src/view/appView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import React from "react";

import type { IInventoryListAppModel } from "../modelInterfaces.js";

import { InventoryListView } from "./inventoryView.js";

export interface IInventoryListAppViewProps {
Expand Down
1 change: 1 addition & 0 deletions examples/apps/tree-comparison/src/view/inventoryView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import React, { FC, useEffect, useRef, useState } from "react";

import { IInventoryItem, IInventoryList } from "../modelInterfaces.js";

export interface IInventoryItemViewProps {
Expand Down
2 changes: 2 additions & 0 deletions examples/benchmarks/bubblebench/common/src/view/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
*/

import React, { useEffect, useState } from "react";

import { Stats } from "../stats.js";
import { IAppState, IBubble } from "../types.js";

import { StageView } from "./stage.js";
import { useResizeObserver } from "./useResizeObserver.cjs";

Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/bubblebench/common/src/view/bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import React from "react";

import { IBubble } from "../types.js";

export type IBubbleProps = Pick<IBubble, "x" | "y" | "r">;
Expand Down
2 changes: 2 additions & 0 deletions examples/benchmarks/bubblebench/common/src/view/stage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*/

import React from "react";

import { IAppState } from "../types.js";

import { BubbleView } from "./bubble.js";

export interface IStage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { IAppState, makeBubble, randomColor } from "@fluid-example/bubblebench-common";

import { ClientWrapper } from "./client.js";
import { ClientsField, FlexBubble, FlexClient } from "./schema.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { IBubble } from "@fluid-example/bubblebench-common";

import { Bubble } from "./schema.js";

export class BubbleWrapper implements IBubble {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SharedTreeFactory,
fail,
} from "@fluidframework/tree/internal";

import { AppState } from "./appState.js";
import { appSchemaData, rootAppStateSchema } from "./schema.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { IClient } from "@fluid-example/bubblebench-common";

import { BubbleWrapper } from "./bubble.js";
import { Client, FlexBubble } from "./schema.js";

Expand Down
2 changes: 1 addition & 1 deletion examples/benchmarks/bubblebench/ot/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import { SharedJson1 } from "@fluid-experimental/sharejs-json1";
import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct";

import { IFluidHandle } from "@fluidframework/core-interfaces";

import { AppState } from "./state.js";

/**
Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/bubblebench/ot/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
randomColor,
} from "@fluid-example/bubblebench-common";
import { SharedJson1 } from "@fluid-experimental/sharejs-json1";

import { observe } from "./proxy/index.js";

interface IApp {
Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/bubblebench/sharedtree/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { IArrayish, IClient } from "@fluid-example/bubblebench-common";
import { SharedTree, WriteFormat } from "@fluid-experimental/tree";
import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct";
import { IFluidHandle } from "@fluidframework/core-interfaces";

import { TreeObjectProxy } from "./proxy/index.js";
import { AppState } from "./state.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
TraitLabel,
} from "@fluid-experimental/tree";
import { Serializable } from "@fluidframework/datastore-definitions";

import { NodeKind, fromJson } from "./treeutils.js";

function getChild(
Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/bubblebench/sharedtree/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
makeClient,
} from "@fluid-example/bubblebench-common";
import { Change, SharedTree } from "@fluid-experimental/tree";

import { TreeArrayProxy, TreeObjectProxy, fromJson } from "./proxy/index.js";

interface IApp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import express, { type Response } from "express";
import webpack from "webpack";
import webpackDevMiddleware from "webpack-dev-middleware";
import webpackHotMiddleware from "webpack-hot-middleware";

import config from "../webpack.config.cjs";

import { _dirname } from "./dirname.cjs";

const getThisOrigin = (port: number): string => `http://localhost:${port}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { assert } from "@fluidframework/core-utils";
import { prefetchLatestSnapshot } from "@fluidframework/odsp-driver";
import { FluidAppOdspUrlResolver } from "@fluidframework/odsp-urlresolver";
import { MockLogger } from "@fluidframework/telemetry-utils";

import { OdspSampleCache } from "./odspPersistantCache.js";

export function start(div: HTMLDivElement, odspAccessToken: string) {
Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/tablebench/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { TreeConfiguration } from "@fluidframework/tree";

import { initFluid } from "./azure.js";
import { generateTable } from "./data.js";
import { Table } from "./tree/index.js";
Expand Down
1 change: 1 addition & 0 deletions examples/benchmarks/tablebench/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { IRandom, makeRandom } from "@fluid-private/stochastic-test-utils";
import { InsertableTypedNode } from "@fluidframework/tree";

import { Row } from "./tree/index.js";

export function generateRow(random: IRandom): InsertableTypedNode<typeof Row> {
Expand Down
2 changes: 2 additions & 0 deletions examples/benchmarks/tablebench/src/test/table.bench.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { BenchmarkType, benchmark, isInPerformanceTestingMode } from "@fluid-too
import { IChannel } from "@fluidframework/datastore-definitions";
import { SharedMatrix } from "@fluidframework/matrix";
import { type ITree, NodeFromSchema, SharedTree } from "@fluidframework/tree";

import { Table, generateTable } from "../index.js";

import { create, measureAttachmentSummary, measureEncodedLength } from "./utils.js";

const numRows = isInPerformanceTestingMode ? 10000 : 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import React from "react";
import ReactDOM from "react-dom";

import { App } from "../components/index.js";

console.log("Rendering app...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
* Licensed under the MIT License.
*/

import { CollaborativeTextArea, SharedStringHelper } from "@fluid-example/example-utils";
import { IFluidHandle } from "@fluidframework/core-interfaces";
import { SharedCounter } from "@fluidframework/counter";
import { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
import { type ISharedMap, SharedMap } from "@fluidframework/map";
import { SharedString } from "@fluidframework/sequence";
import React from "react";

import { CollaborativeTextArea, SharedStringHelper } from "@fluid-example/example-utils";

import {
ContainerInfo,
createFluidContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { render, screen } from "@testing-library/react";
import React from "react";

import { App } from "../../components/index.js";

describe("App Insights Example App UI test", () => {
Expand Down
1 change: 1 addition & 0 deletions examples/data-objects/canvas/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ContainerViewRuntimeFactory } from "@fluid-example/example-utils";
import { Ink } from "@fluid-experimental/ink";
import { DataObjectFactory } from "@fluidframework/aqueduct";
import React from "react";

import { Canvas } from "./canvas.js";
import { CanvasView } from "./view.js";

Expand Down
1 change: 0 additions & 1 deletion examples/data-objects/canvas/src/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import { IColor, InkCanvas } from "@fluid-experimental/ink";

import React, { useEffect, useRef, useState } from "react";

import { Canvas } from "./canvas.js";
Expand Down
1 change: 1 addition & 0 deletions examples/data-objects/clicker/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { IEvent, IFluidHandle } from "@fluidframework/core-interfaces";
import { SharedCounter } from "@fluidframework/counter";
import { TaskManager } from "@fluidframework/task-manager";
import React from "react";

import { ClickerAgent } from "./agent.js";

export const ClickerName = "Clicker";
Expand Down
1 change: 0 additions & 1 deletion examples/data-objects/codemirror/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { IContainerRuntime } from "@fluidframework/container-runtime-definitions
import { FluidObject } from "@fluidframework/core-interfaces";
import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";

import React from "react";

import { CodeMirrorComponent, SmdeFactory } from "./codeMirror.js";
Expand Down
1 change: 1 addition & 0 deletions examples/data-objects/inventory-app/src/inventoryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { DataObjectFactory } from "@fluidframework/aqueduct";

import { TreeDataObject, factory } from "./reactSharedTreeView.js";
import { type Inventory, treeConfiguration } from "./schema.js";

Expand Down
Loading

0 comments on commit 6e6ee6d

Please sign in to comment.