Skip to content

Commit

Permalink
Fix lint errors introduced since Deno 1.42.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Mar 29, 2024
1 parent 326a5ab commit 562c62c
Show file tree
Hide file tree
Showing 34 changed files with 72 additions and 65 deletions.
4 changes: 2 additions & 2 deletions codegen/__snapshots__/class.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ snapshot[`generateClasses() 1`] = `
import { Temporal } from \\"@js-temporal/polyfill\\";
// @ts-ignore TS7016
import jsonld from \\"jsonld\\";
import { LanguageTag, parseLanguageTag }
import { type LanguageTag, parseLanguageTag }
from \\"@phensley/language-tag\\";
import { exportSPKI, importSPKI } from \\"jose\\";
import { DocumentLoader, fetchDocumentLoader }
import { type DocumentLoader, fetchDocumentLoader }
from \\"../runtime/docloader.ts\\";
import { LanguageString } from \\"../runtime/langstr.ts\\";

Expand Down
6 changes: 3 additions & 3 deletions codegen/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { generateCloner, generateConstructor } from "./constructor.ts";
import { generateFields } from "./field.ts";
import { generateInspector } from "./inspector.ts";
import { generateProperties } from "./property.ts";
import { TypeSchema } from "./schema.ts";
import type { TypeSchema } from "./schema.ts";

/**
* Sorts the given types topologically so that the base types come before the
Expand Down Expand Up @@ -72,10 +72,10 @@ export async function* generateClasses(
yield 'import { Temporal } from "@js-temporal/polyfill";\n';
yield "// @ts-ignore TS7016\n";
yield 'import jsonld from "jsonld";\n';
yield `import { LanguageTag, parseLanguageTag }
yield `import { type LanguageTag, parseLanguageTag }
from "@phensley/language-tag";\n`;
yield `import { exportSPKI, importSPKI } from "jose";\n`;
yield `import { DocumentLoader, fetchDocumentLoader }
yield `import { type DocumentLoader, fetchDocumentLoader }
from "${runtimePath}/docloader.ts";\n`;
yield `import { LanguageString } from "${runtimePath}/langstr.ts";\n`;
yield "\n\n";
Expand Down
2 changes: 1 addition & 1 deletion codegen/codec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateField, getFieldName } from "./field.ts";
import { TypeSchema } from "./schema.ts";
import type { TypeSchema } from "./schema.ts";
import {
areAllScalarTypes,
getDecoder,
Expand Down
2 changes: 1 addition & 1 deletion codegen/constructor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getFieldName } from "./field.ts";
import { PropertySchema, TypeSchema } from "./schema.ts";
import type { PropertySchema, TypeSchema } from "./schema.ts";
import { areAllScalarTypes, getTypeNames } from "./type.ts";

function generateParameterType(
Expand Down
2 changes: 1 addition & 1 deletion codegen/field.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { encodeBase58 } from "@std/encoding/base58";
import { PropertySchema, TypeSchema } from "./schema.ts";
import type { PropertySchema, TypeSchema } from "./schema.ts";
import { areAllScalarTypes, getTypeNames } from "./type.ts";

export async function getFieldName(
Expand Down
2 changes: 1 addition & 1 deletion codegen/inspector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getFieldName } from "./field.ts";
import { TypeSchema } from "./schema.ts";
import type { TypeSchema } from "./schema.ts";
import { areAllScalarTypes } from "./type.ts";

export async function* generateInspector(
Expand Down
2 changes: 1 addition & 1 deletion codegen/property.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { toPascalCase } from "@std/text";
import { getFieldName } from "./field.ts";
import { PropertySchema, TypeSchema } from "./schema.ts";
import type { PropertySchema, TypeSchema } from "./schema.ts";
import { areAllScalarTypes, getTypeNames } from "./type.ts";

async function* generateProperty(
Expand Down
2 changes: 1 addition & 1 deletion codegen/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Schema as JsonSchema, Validator } from "@cfworker/json-schema";
import { type Schema as JsonSchema, Validator } from "@cfworker/json-schema";
import { join } from "@std/path";
import * as url from "@std/url";
import { parse } from "@std/yaml";
Expand Down
2 changes: 1 addition & 1 deletion codegen/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TypeSchema } from "./schema.ts";
import type { TypeSchema } from "./schema.ts";

interface ScalarType {
name: string;
Expand Down
10 changes: 5 additions & 5 deletions federation/callback.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NodeInfo } from "../nodeinfo/types.ts";
import { Actor } from "../vocab/actor.ts";
import { Activity, CryptographicKey } from "../vocab/mod.ts";
import { PageItems } from "./collection.ts";
import { RequestContext } from "./context.ts";
import type { NodeInfo } from "../nodeinfo/types.ts";
import type { Actor } from "../vocab/actor.ts";
import type { Activity, CryptographicKey } from "../vocab/mod.ts";
import type { PageItems } from "./collection.ts";
import type { RequestContext } from "./context.ts";

/**
* A callback that dispatches a {@link NodeInfo} object.
Expand Down
6 changes: 3 additions & 3 deletions federation/context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DocumentLoader } from "../runtime/docloader.ts";
import { Actor } from "../vocab/actor.ts";
import { Activity, CryptographicKey } from "../vocab/mod.ts";
import type { DocumentLoader } from "../runtime/docloader.ts";
import type { Actor } from "../vocab/actor.ts";
import type { Activity, CryptographicKey } from "../vocab/mod.ts";

/**
* A context.
Expand Down
4 changes: 2 additions & 2 deletions federation/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert, assertEquals, assertFalse } from "@std/assert";
import { createRequestContext } from "../testing/context.ts";
import { mockDocumentLoader } from "../testing/docloader.ts";
import { Activity, Create, Note, Person } from "../vocab/vocab.ts";
import {
import { type Activity, Create, Note, Person } from "../vocab/vocab.ts";
import type {
ActorDispatcher,
CollectionCounter,
CollectionCursor,
Expand Down
12 changes: 6 additions & 6 deletions federation/handler.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Temporal } from "@js-temporal/polyfill";
import { accepts } from "@std/http/negotiation";
import { doesActorOwnKey, verify } from "../httpsig/mod.ts";
import { DocumentLoader } from "../runtime/docloader.ts";
import type { DocumentLoader } from "../runtime/docloader.ts";
import {
Activity,
Link,
Object,
type Link,
type Object,
OrderedCollection,
OrderedCollectionPage,
} from "../vocab/vocab.ts";
import {
import type {
ActorDispatcher,
CollectionCounter,
CollectionCursor,
CollectionDispatcher,
InboxErrorHandler,
InboxListener,
} from "./callback.ts";
import { RequestContext } from "./context.ts";
import { KvKey, KvStore } from "./kv.ts";
import type { RequestContext } from "./context.ts";
import type { KvKey, KvStore } from "./kv.ts";

export function acceptsJsonLd(request: Request): boolean {
const types = accepts(request);
Expand Down
2 changes: 1 addition & 1 deletion federation/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { mockDocumentLoader } from "../testing/docloader.ts";
import { privateKey2, publicKey2 } from "../testing/keys.ts";
import { Create, Person } from "../vocab/vocab.ts";
import { Context } from "./context.ts";
import type { Context } from "./context.ts";
import { MemoryKvStore } from "./kv.ts";
import { Federation } from "./middleware.ts";
import { RouterError } from "./router.ts";
Expand Down
22 changes: 13 additions & 9 deletions federation/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { Temporal } from "@js-temporal/polyfill";
import { exportJwk, importJwk, validateCryptoKey } from "../httpsig/key.ts";
import { handleNodeInfo, handleNodeInfoJrd } from "../nodeinfo/handler.ts";
import {
AuthenticatedDocumentLoaderFactory,
DocumentLoader,
type AuthenticatedDocumentLoaderFactory,
type DocumentLoader,
fetchDocumentLoader,
getAuthenticatedDocumentLoader,
kvCache,
} from "../runtime/docloader.ts";
import { Actor } from "../vocab/actor.ts";
import type { Actor } from "../vocab/actor.ts";
import { Activity, CryptographicKey } from "../vocab/mod.ts";
import { handleWebFinger } from "../webfinger/handler.ts";
import {
import type {
ActorDispatcher,
ActorKeyPairDispatcher,
CollectionCounter,
Expand All @@ -21,16 +21,20 @@ import {
InboxListener,
NodeInfoDispatcher,
} from "./callback.ts";
import { Context, RequestContext, SendActivityOptions } from "./context.ts";
import type {
Context,
RequestContext,
SendActivityOptions,
} from "./context.ts";
import {
CollectionCallbacks,
type CollectionCallbacks,
handleActor,
handleCollection,
handleInbox,
} from "./handler.ts";
import { KvKey, KvStore } from "./kv.ts";
import { MessageQueue } from "./mq.ts";
import { OutboxMessage } from "./queue.ts";
import type { KvKey, KvStore } from "./kv.ts";
import type { MessageQueue } from "./mq.ts";
import type { OutboxMessage } from "./queue.ts";
import { Router, RouterError } from "./router.ts";
import { extractInboxes, sendActivity } from "./send.ts";

Expand Down
2 changes: 1 addition & 1 deletion federation/send.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as mf from "mock_fetch";
import { doesActorOwnKey, verify } from "../httpsig/mod.ts";
import { mockDocumentLoader } from "../testing/docloader.ts";
import { privateKey2, publicKey2 } from "../testing/keys.ts";
import { Actor } from "../vocab/actor.ts";
import type { Actor } from "../vocab/actor.ts";
import {
Activity,
Application,
Expand Down
6 changes: 3 additions & 3 deletions federation/send.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sign } from "../httpsig/mod.ts";
import { DocumentLoader } from "../runtime/docloader.ts";
import { Actor } from "../vocab/actor.ts";
import { Activity } from "../vocab/mod.ts";
import type { DocumentLoader } from "../runtime/docloader.ts";
import type { Actor } from "../vocab/actor.ts";
import type { Activity } from "../vocab/mod.ts";

/**
* Parameters for {@link extractInboxes}.
Expand Down
4 changes: 2 additions & 2 deletions httpsig/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import { Temporal } from "@js-temporal/polyfill";
import { equals } from "@std/bytes";
import { decodeBase64, encodeBase64 } from "@std/encoding/base64";
import { DocumentLoader } from "../runtime/docloader.ts";
import type { DocumentLoader } from "../runtime/docloader.ts";
import { isActor } from "../vocab/actor.ts";
import {
Activity,
type Activity,
CryptographicKey,
Object as ASObject,
} from "../vocab/vocab.ts";
Expand Down
2 changes: 1 addition & 1 deletion nodeinfo/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertEquals } from "@std/assert";
import { parse } from "@std/semver";
import { NodeInfoDispatcher } from "../federation/callback.ts";
import type { NodeInfoDispatcher } from "../federation/callback.ts";
import { createRequestContext } from "../testing/context.ts";
import { handleNodeInfo, handleNodeInfoJrd } from "./handler.ts";

Expand Down
6 changes: 3 additions & 3 deletions nodeinfo/handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NodeInfoDispatcher } from "../federation/callback.ts";
import { RequestContext } from "../federation/context.ts";
import type { NodeInfoDispatcher } from "../federation/callback.ts";
import type { RequestContext } from "../federation/context.ts";
import { RouterError } from "../federation/router.ts";
import { Link, ResourceDescriptor } from "../webfinger/jrd.ts";
import type { Link, ResourceDescriptor } from "../webfinger/jrd.ts";
import { nodeInfoToJson } from "./types.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion nodeinfo/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals, assertThrows } from "@std/assert";
import { NodeInfo, nodeInfoToJson } from "./types.ts";
import { type NodeInfo, nodeInfoToJson } from "./types.ts";

Deno.test("nodeInfoToJson()", () => {
const validInfo: NodeInfo = {
Expand Down
2 changes: 1 addition & 1 deletion nodeinfo/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { format, SemVer } from "@std/semver";
import { format, type SemVer } from "@std/semver";

/**
* The type of the result of parsing JSON.
Expand Down
2 changes: 1 addition & 1 deletion runtime/docloader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Temporal } from "@js-temporal/polyfill";
import { KvKey, KvStore } from "../federation/kv.ts";
import type { KvKey, KvStore } from "../federation/kv.ts";
import { validateCryptoKey } from "../httpsig/key.ts";
import { sign } from "../httpsig/mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion runtime/langstr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LanguageTag, parseLanguageTag } from "@phensley/language-tag";
import { type LanguageTag, parseLanguageTag } from "@phensley/language-tag";

/**
* A language-tagged string which corresponds to the `rdf:langString` type.
Expand Down
2 changes: 1 addition & 1 deletion testing/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context, RequestContext } from "../federation/context.ts";
import type { Context, RequestContext } from "../federation/context.ts";
import { RouterError } from "../federation/router.ts";
import { mockDocumentLoader } from "./docloader.ts";

Expand Down
2 changes: 1 addition & 1 deletion testing/docloader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, fromFileUrl, join } from "@std/path";
import { RemoteDocument } from "../runtime/docloader.ts";
import type { RemoteDocument } from "../runtime/docloader.ts";

/**
* A mock of the document loader. This does not make any actual HTTP requests
Expand Down
2 changes: 1 addition & 1 deletion vocab/actor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import * as fc from "fast-check";
import * as mf from "mock_fetch";
import {
Actor,
type Actor,
getActorClassByTypeName,
getActorHandle,
getActorTypeName,
Expand Down
5 changes: 4 additions & 1 deletion vocab/lookup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DocumentLoader, fetchDocumentLoader } from "../runtime/docloader.ts";
import {
type DocumentLoader,
fetchDocumentLoader,
} from "../runtime/docloader.ts";
import { lookupWebFinger } from "../webfinger/lookup.ts";
import { Object } from "./vocab.ts";

Expand Down
4 changes: 2 additions & 2 deletions vocab/vocab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { toPascalCase } from "@std/text";
import { toArray } from "https://deno.land/x/[email protected]/mod.ts";
import {
loadSchemaFiles,
PropertySchema,
TypeSchema,
type PropertySchema,
type TypeSchema,
} from "../codegen/schema.ts";
import { areAllScalarTypes } from "../codegen/type.ts";
import { LanguageString } from "../runtime/langstr.ts";
Expand Down
2 changes: 1 addition & 1 deletion webfinger/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals } from "@std/assert";
import { ActorDispatcher } from "../federation/callback.ts";
import type { ActorDispatcher } from "../federation/callback.ts";
import { createRequestContext } from "../testing/context.ts";
import { CryptographicKey, Link, Person } from "../vocab/vocab.ts";
import { handleWebFinger } from "./handler.ts";
Expand Down
6 changes: 3 additions & 3 deletions webfinger/handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ActorDispatcher } from "../federation/callback.ts";
import { RequestContext } from "../federation/context.ts";
import type { ActorDispatcher } from "../federation/callback.ts";
import type { RequestContext } from "../federation/context.ts";
import { Link as LinkObject } from "../vocab/mod.ts";
import { Link, ResourceDescriptor } from "./jrd.ts";
import type { Link, ResourceDescriptor } from "./jrd.ts";

/**
* Parameters for {@link handleWebFinger}.
Expand Down
2 changes: 1 addition & 1 deletion webfinger/lookup.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertEquals } from "@std/assert";
import * as mf from "mock_fetch";
import { ResourceDescriptor } from "./jrd.ts";
import type { ResourceDescriptor } from "./jrd.ts";
import { lookupWebFinger } from "./lookup.ts";

Deno.test("lookupWebFinger()", async (t) => {
Expand Down
2 changes: 1 addition & 1 deletion webfinger/lookup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ResourceDescriptor } from "./jrd.ts";
import type { ResourceDescriptor } from "./jrd.ts";

/**
* Looks up a WebFinger resource.
Expand Down
2 changes: 1 addition & 1 deletion x/fresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @module
*/
import {
import type {
Federation,
FederationHandlerParameters,
} from "../federation/middleware.ts";
Expand Down

0 comments on commit 562c62c

Please sign in to comment.