Skip to content

Commit

Permalink
Cleanup TypeScript stuff (#150)
Browse files Browse the repository at this point in the history
* Bump typescript and any ts related packages

* Update tsconfig.json

* Fix types
  • Loading branch information
brookslybrand authored Dec 13, 2024
1 parent d1ffda4 commit 3ae9298
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 557 deletions.
2 changes: 1 addition & 1 deletion app/components/doc-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from "react";
import { type Doc } from "~/modules/gh-docs/.server";
import type { Doc } from "~/modules/gh-docs/.server";
import { useDelegatedReactRouterLinks } from "~/ui/delegate-markdown-links";
import { LargeOnThisPage, SmallOnThisPage } from "./on-this-page";

Expand Down
2 changes: 1 addition & 1 deletion app/components/on-this-page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from "react-router";
import { type Doc } from "~/modules/gh-docs/.server";
import type { Doc } from "~/modules/gh-docs/.server";
import iconsHref from "~/icons.svg";
import { useEffect, useRef, useState } from "react";
import classNames from "classnames";
Expand Down
2 changes: 1 addition & 1 deletion app/components/package-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import iconsHref from "~/icons.svg";
import { DetailsMenu } from "~/modules/details-menu";
import { DetailsPopup } from "./details-popup";
import { PopupLabel } from "./popup-label";
import { type Pkg } from "~/components/docs-menu/data.server";
import type { Pkg } from "~/components/docs-menu/data.server";

export function PackageSelect({ pkgs }: { pkgs: Pkg[] }) {
let { pkg } = useParams();
Expand Down
8 changes: 4 additions & 4 deletions app/modules/details-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ export let DetailsMenu = React.forwardRef<
ref={forwardedRef}
open={open ?? isOpen}
onToggle={(event) => {
onToggle && onToggle(event);
if (onToggle) onToggle(event);
if (event.defaultPrevented) return;
setIsOpen(event.currentTarget.open);
}}
onMouseDown={(event) => {
onMouseDown && onMouseDown(event);
if (onMouseDown) onMouseDown(event);
if (event.defaultPrevented) return;
if (isOpen) clickRef.current = true;
}}
onTouchStart={(event) => {
onTouchStart && onTouchStart(event);
if (onTouchStart) onTouchStart(event);
if (event.defaultPrevented) return;
if (isOpen) clickRef.current = true;
}}
onFocus={(event) => {
onFocus && onFocus(event);
if (onFocus) onFocus(event);
if (event.defaultPrevented) return;
if (isOpen) focusRef.current = true;
}}
Expand Down
2 changes: 1 addition & 1 deletion app/modules/stats/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ global.statCountsCache ??= new LRUCache<string, StatCounts>({
ttl: 1000 * 60 * 60, // 1 hour
allowStale: true,
noDeleteOnFetchRejection: true,
fetchMethod: async (key) => {
fetchMethod: async () => {
console.log("Fetching fresh stats");
let [npmDownloads, githubContributors, githubStars, githubDependents] =
await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion app/ui/meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type loader as docsLoader } from "~/pages/docs-layout";
import type { loader as docsLoader } from "~/pages/docs-layout";

type DocsData = Awaited<ReturnType<typeof docsLoader>>;

Expand Down
2 changes: 1 addition & 1 deletion app/ui/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function useCodeBlockCopyButton(ref: React.RefObject<HTMLElement>) {
{ listener: (event: MouseEvent) => void; to: number }
>();

for (let codeBlock of codeBlocks) {
for (const codeBlock of codeBlocks) {
let button = document.createElement("button");
let label = document.createElement("span");
button.type = "button";
Expand Down
2 changes: 0 additions & 2 deletions env.d.ts

This file was deleted.

Loading

0 comments on commit 3ae9298

Please sign in to comment.