diff --git a/CHANGELOG.md b/CHANGELOG.md index 59bd59c9c..694229e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ - Extracted `loadGraphData.ts` and `util.ts` (both TypeScript) out of `js/components/graph/Graph.js`, and moved `js/util/util.ts` to `js/components/graph/requirementParser.ts` - Changed SVG parsing to leave the `fill` column empty when inserting hybrid nodes into the database - Refactored `js/components/grid/course_panel.js.jsx` into separate typescript react components +- Fixed type-only Typescript imports and added `verbatimModuleSyntax: true` to `tsconfig.json` ## [0.8.1] - 2026-08-10 diff --git a/js/components/common/NavBar.tsx b/js/components/common/NavBar.tsx index f1d26657b..ad71efc4d 100644 --- a/js/components/common/NavBar.tsx +++ b/js/components/common/NavBar.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faDownload } from "@fortawesome/free-solid-svg-icons" import { Tooltip } from "react-tooltip" import GraphDropdown from "../graph/GraphDropdown" -import { Graph } from "../graph/types" +import type { Graph } from "../graph/types" interface NavBarProps { selected_page: string diff --git a/js/components/common/export.tsx b/js/components/common/export.tsx index ced95cbb0..59e12410d 100644 --- a/js/components/common/export.tsx +++ b/js/components/common/export.tsx @@ -1,6 +1,6 @@ import React, { useImperativeHandle, useState } from "react" import ReactModal from "react-modal" -import { SelectedLecture } from "../grid/types" +import type { SelectedLecture } from "../grid/types" if (document.getElementById("nav-export")) { ReactModal.setAppElement("#nav-export") diff --git a/js/components/generate/AutocompleteDropdown.tsx b/js/components/generate/AutocompleteDropdown.tsx index 8e9c29211..238460b54 100644 --- a/js/components/generate/AutocompleteDropdown.tsx +++ b/js/components/generate/AutocompleteDropdown.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react" -import Autocomplete, { AutocompleteProps } from "@mui/material/Autocomplete" +import Autocomplete, { type AutocompleteProps } from "@mui/material/Autocomplete" import Chip from "@mui/material/Chip" import { useField } from "formik" diff --git a/js/components/graph/Bool.tsx b/js/components/graph/Bool.tsx index 47aa045ce..719e88d80 100644 --- a/js/components/graph/Bool.tsx +++ b/js/components/graph/Bool.tsx @@ -1,4 +1,4 @@ -import { GraphNodeJSON } from "./types" +import type { GraphNodeJSON } from "./types" interface BoolProps { className?: string diff --git a/js/components/graph/GraphDropdown.tsx b/js/components/graph/GraphDropdown.tsx index 943f74829..dca387633 100644 --- a/js/components/graph/GraphDropdown.tsx +++ b/js/components/graph/GraphDropdown.tsx @@ -1,4 +1,4 @@ -import { Graph } from "./types" +import type { Graph } from "./types" interface GraphDropdownProps { showGraphDropdown?: boolean diff --git a/js/components/graph/Node.tsx b/js/components/graph/Node.tsx index bfade01f4..fdb8d8e32 100644 --- a/js/components/graph/Node.tsx +++ b/js/components/graph/Node.tsx @@ -1,5 +1,5 @@ import React from "react" -import { GraphNodeJSON } from "./types" +import type { GraphNodeJSON } from "./types" interface NodeProps { className: string diff --git a/js/components/graph/graphState.ts b/js/components/graph/graphState.ts index 43c6bf4da..a888731f9 100644 --- a/js/components/graph/graphState.ts +++ b/js/components/graph/graphState.ts @@ -1,6 +1,6 @@ -import { parseAnd, PrereqTree } from "./requirementParser" +import { parseAnd, type PrereqTree } from "./requirementParser" import { findRelationship, numCredits } from "./util" -import { LoadedGraphData } from "./loadGraphData" +import type { LoadedGraphData } from "./loadGraphData" /** The parts of Graph's state that describe the graph's nodes, bools, and their statuses. */ export type GraphState = Pick< diff --git a/js/components/graph/loadGraphData.ts b/js/components/graph/loadGraphData.ts index e97095ea3..7779749a6 100644 --- a/js/components/graph/loadGraphData.ts +++ b/js/components/graph/loadGraphData.ts @@ -1,5 +1,5 @@ import { populateHybridRelatives } from "./util" -import { GraphNodeJSON } from "./types" +import { type GraphNodeJSON } from "./types" interface GraphLabelEntry { rId: string diff --git a/js/components/graph/util.ts b/js/components/graph/util.ts index 8aff0edc2..8cd28b2b9 100644 --- a/js/components/graph/util.ts +++ b/js/components/graph/util.ts @@ -1,5 +1,5 @@ import { parseAnd } from "./requirementParser" -import { GraphNodeJSON } from "./types" +import type { GraphNodeJSON } from "./types" /** * Helper function to populate `parentsObj` and `childrenObj` with the connections of a hybrid node. diff --git a/js/components/grid/grid.tsx b/js/components/grid/grid.tsx index 1e31f5150..97faf9a06 100644 --- a/js/components/grid/grid.tsx +++ b/js/components/grid/grid.tsx @@ -2,9 +2,9 @@ import { useEffect, useState, useRef } from "react" import { CoursePanel } from "./course_panel" import { Row } from "./calendar.js.jsx" -import { ExportModal, ExportModalHandle } from "../common/export" +import { ExportModal, type ExportModalHandle } from "../common/export" import Disclaimer from "../common/Disclaimer" -import { SelectedLecture } from "./types" +import type { SelectedLecture } from "./types" import { AllCommunityModule, diff --git a/tsconfig.json b/tsconfig.json index 4fc480199..e5e2ae226 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,7 @@ "esModuleInterop": true, "resolveJsonModule": true, "isolatedModules": true, + "verbatimModuleSyntax": true, "skipLibCheck": true, "noEmit": true },