Skip to content

Commit

Permalink
enforce type keyword when importing types
Browse files Browse the repository at this point in the history
  • Loading branch information
DaleSeo committed Jan 1, 2025
1 parent 17f0840 commit 418669b
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/api/infra/gitHub/gitHubClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, beforeEach, vi } from "vitest";
import { mock } from "vitest-mock-extended";
import { createGitHubClient } from "./gitHubClient";
import { GitHubMember, GitHubTeam, GitHubTree } from "./types";
import type { GitHubMember, GitHubTeam, GitHubTree } from "./types";

// Mock data
const mockGitHubTeams = mock<GitHubTeam[]>();
Expand Down
8 changes: 6 additions & 2 deletions src/api/services/fetch/fetchService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { beforeEach, expect, test, vi } from "vitest";
import { mock } from "vitest-mock-extended";
import { createGitHubClient } from "../../infra/gitHub/gitHubClient";
import { createFetchService } from "./fetchService";
import { Grade } from "../types";
import { GitHubMember, GitHubTeam, GitHubTree } from "../../infra/gitHub/types";
import type { Grade } from "../types";
import type {
GitHubMember,
GitHubTeam,
GitHubTree,
} from "../../infra/gitHub/types";

// Mock data
const dummyConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/api/services/process/processService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mock } from "vitest-mock-extended";

import { problems } from "../../constants/problems";
import type { Config } from "../../config/types";
import { Grade, MemberIdentity, Submission } from "../types";
import type { Grade, MemberIdentity, Submission } from "../types";
import { createProcessService } from "./processService";

// Mock data
Expand Down
7 changes: 1 addition & 6 deletions src/api/services/process/processService.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { problemMap } from "../../constants/problems";
import type { Config } from "../../config/types";
import {
Grade,
type Member,
type MemberIdentity,
type Submission,
} from "../types";
import type { Grade, Member, MemberIdentity, Submission } from "../types";

export function createProcessService(config: Config) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grade } from "../../api/services/types";
import type { Grade } from "../../api/services/types";
import GradeImage from "../GradeImage/GradeImage";
import Link from "../Link/Link";
import styles from "./Card.module.css";
Expand Down
2 changes: 1 addition & 1 deletion src/components/GradeImage/GradeImage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grade } from "../../api/services/types";
import type { Grade } from "../../api/services/types";
import SeedImage from "../../assets/GradeSeed.png";
import SproutImage from "../../assets/GradeSprout.png";
import LeafImage from "../../assets/GradeLeaf.png";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef } from "react";
import { Grade } from "../../api/services/types";
import type { Grade } from "../../api/services/types";
import Github from "../../assets/Github.png";
import GradeImage from "../GradeImage/GradeImage";
import styles from "./Sidebar.module.css";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes } from "react";
import type { HTMLAttributes } from "react";
import styles from "./Spinner.module.css";

export default function Spinner(props: HTMLAttributes<SVGElement>) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Certificate/Certificate.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import userEvent from "@testing-library/user-event";
import { afterAll, expect, test, vi } from "vitest";
import { mock } from "vitest-mock-extended";

import { Member } from "../../api/services/types";
import type { Member } from "../../api/services/types";
import useMembers from "../../hooks/useMembers";
import Certificate from "./Certificate";
import { gradeEmojiMap } from "./constants";
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"verbatimModuleSyntax": true
},
"include": [
"src",
Expand Down

0 comments on commit 418669b

Please sign in to comment.