Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Adammatthiesen committed Nov 9, 2024
1 parent b77ef79 commit 1bba8ba
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 30 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
},
"files": {
"include": ["packages/**/*"],
"ignore": ["dist", ".astro"]
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"scripts": {
"playground:dev": "pnpm --filter playground dev",
"twoslash:build": "pnpm --filter expressive-code-twoslash build",
"docs:dev": "pnpm --filter docs dev",
"docs:dev": "pnpm --filter docs-twoslash dev",
"changeset": "changeset",
"lint": "biome check .",
"lint:fix": "biome check --apply .",
"lint:fix": "biome check --write .",
"ci:install": "pnpm install --frozen-lockfile",
"ci:version": "changeset version",
"ci:publish": "changeset publish",
Expand Down
6 changes: 3 additions & 3 deletions packages/twoslash/src/annotation.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
type AnnotationRenderOptions,
ExpressiveCodeAnnotation,
type ExpressiveCodeLine,
type AnnotationRenderOptions,
} from "@expressive-code/core";
import { h, type Root, type Element } from "@expressive-code/core/hast";
import { type Element, type Root, h } from "@expressive-code/core/hast";
import type {
NodeCompletion,
NodeError,
Expand All @@ -12,7 +12,6 @@ import type {
NodeQuery,
NodeTag,
} from "twoslash";
import type { CompletionItem, CustomTagsIcon, TwoslashTag } from "./types";
import { customTagsIcons } from "./customTagsIcons";
import {
defaultHoverInfoProcessor,
Expand All @@ -25,6 +24,7 @@ import {
renderMarkdown,
renderMarkdownInline,
} from "./helpers";
import type { CompletionItem, CustomTagsIcon, TwoslashTag } from "./types";

export class TwoslashErrorUnderlineAnnotation extends ExpressiveCodeAnnotation {
constructor(readonly error: NodeError) {
Expand Down
36 changes: 18 additions & 18 deletions packages/twoslash/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,18 @@ import type {
ExpressiveCodeBlock,
ExpressiveCodeLine,
} from "@expressive-code/core";
import {
reFunctionCleanup,
reImportStatement,
reInterfaceOrNamespace,
reJsDocLink,
reJsDocTagFilter,
reLeadingPropertyMethod,
reTrigger,
reTypeCleanup,
twoslashDefaultTags,
} from "./regex";
import type { Element, ElementContent } from "@expressive-code/core/hast";
import { fromMarkdown } from "mdast-util-from-markdown";
import { gfmFromMarkdown } from "mdast-util-gfm";
import { toHast } from "mdast-util-to-hast";
import type {
NodeCompletion,
NodeError,
TwoslashInstance,
TwoslashOptions,
TwoslashReturn,
} from "twoslash";
import { completionIcons } from "./completionIcons";
import ts, { type CompilerOptions } from "typescript";
import {
TwoslashCompletionAnnotation,
TwoslashCustomTagsAnnotation,
Expand All @@ -30,12 +23,19 @@ import {
TwoslashHoverAnnotation,
TwoslashStaticAnnotation,
} from "./annotation";
import ts, { type CompilerOptions } from "typescript";
import type { CompletionItem, CompletionIcon, TwoslashTag } from "./types";
import type { Element, ElementContent } from "@expressive-code/core/hast";
import { fromMarkdown } from "mdast-util-from-markdown";
import { gfmFromMarkdown } from "mdast-util-gfm";
import { toHast } from "mdast-util-to-hast";
import { completionIcons } from "./completionIcons";
import {
reFunctionCleanup,
reImportStatement,
reInterfaceOrNamespace,
reJsDocLink,
reJsDocTagFilter,
reLeadingPropertyMethod,
reTrigger,
reTypeCleanup,
twoslashDefaultTags,
} from "./regex";
import type { CompletionIcon, CompletionItem, TwoslashTag } from "./types";

/**
* Converts a markdown string into an array of ElementContent objects.
Expand Down
8 changes: 4 additions & 4 deletions packages/twoslash/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { definePlugin, type ExpressiveCodePlugin } from "@expressive-code/core";
import { type ExpressiveCodePlugin, definePlugin } from "@expressive-code/core";
import { createTwoslasher } from "twoslash";
import popupModule from "./module-code/popup.min";
import { getTwoSlashBaseStyles, twoSlashStyleSettings } from "./styles";
import {
addCompletionAnnotations,
addCustomTagAnnotations,
Expand All @@ -10,9 +8,11 @@ import {
addHoverOrStaticAnnotations,
buildMetaChecker,
checkForCustomTagsAndMerge,
replaceECBlockWithTwoslashBlock,
ecTwoslasher,
replaceECBlockWithTwoslashBlock,
} from "./helpers";
import popupModule from "./module-code/popup.min";
import { getTwoSlashBaseStyles, twoSlashStyleSettings } from "./styles";
import type { PluginTwoslashOptions } from "./types";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/twoslash/src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
PluginStyleSettings,
type ResolverContext,
type StyleResolverFn,
toHexColor,
type ResolverContext,
} from "@expressive-code/core";
import type { TwoSlashStyleSettings } from "./types";

Expand Down
4 changes: 2 additions & 2 deletions packages/twoslash/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TwoslashOptions } from "twoslash";
import type { Element } from "@expressive-code/core/hast";
import type { customTagsIcons } from "./customTagsIcons";
import type { TwoslashOptions } from "twoslash";
import type { completionIcons } from "./completionIcons";
import type { customTagsIcons } from "./customTagsIcons";

/**
* Interface representing the options for the PluginTwoslash.
Expand Down

0 comments on commit 1bba8ba

Please sign in to comment.