refactor: use type import
This commit is contained in:
parent
cf653915cd
commit
bd83c47177
14 changed files with 19 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
import { PageData } from "@developomp-site/content/src/types/types"
|
||||
import type { PageData } from "@developomp-site/content/src/types/types"
|
||||
import {
|
||||
faBook,
|
||||
faCalendar,
|
||||
|
|
|
@ -2,7 +2,7 @@ import type { PageData } from "@developomp-site/content/src/types/types"
|
|||
|
||||
import contentMap from "@/contentMap"
|
||||
|
||||
import { Params } from "./page"
|
||||
import type { Params } from "./page"
|
||||
|
||||
export enum PageType {
|
||||
POST,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Metadata } from "next"
|
||||
import type { Metadata } from "next"
|
||||
|
||||
import Home from "./Home"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ReactNode } from "react"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
interface Props {
|
||||
children?: ReactNode
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PostData } from "@developomp-site/content/src/types/types"
|
||||
import type { PostData } from "@developomp-site/content/src/types/types"
|
||||
import {
|
||||
faBook,
|
||||
faCalendar,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ReactNode } from "react"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
interface Props {
|
||||
children?: ReactNode | undefined
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import portfolio from "@developomp-site/content/dist/portfolio.json"
|
||||
import type { PortfolioProject } from "@developomp-site/content/src/types/types"
|
||||
import { Metadata } from "next"
|
||||
import type { Metadata } from "next"
|
||||
|
||||
import Badge from "@/components/Badge"
|
||||
import ProjectCard from "@/components/ProjectCard"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import "./style.scss"
|
||||
|
||||
import { PortfolioProject } from "@developomp-site/content/src/types/types"
|
||||
import type { PortfolioProject } from "@developomp-site/content/src/types/types"
|
||||
import Link from "next/link"
|
||||
|
||||
import Badge from "@/components/Badge"
|
||||
|
|
|
@ -12,7 +12,8 @@ import { mapFilePath, markdownPath, outPath, portfolioFilePath } from "./config"
|
|||
import { fillTags, parseSeries, sortDates } from "./postProcess"
|
||||
import { recursiveParse } from "./recursiveParse"
|
||||
import { saveIndex } from "./searchIndex"
|
||||
import { ContentMap, ParseMode, PortfolioData, SeriesMap } from "./types/types"
|
||||
import type { ContentMap, PortfolioData, SeriesMap } from "./types/types"
|
||||
import { ParseMode } from "./types/types"
|
||||
|
||||
export const contentMap: ContentMap = {
|
||||
date: {},
|
||||
|
|
|
@ -22,7 +22,8 @@ import remarkRehype from "remark-rehype"
|
|||
import supersub from "remark-supersub"
|
||||
import { unified } from "unified"
|
||||
|
||||
import { MarkdownData, ParseMode } from "./types/types"
|
||||
import type { MarkdownData } from "./types/types"
|
||||
import { ParseMode } from "./types/types"
|
||||
import { nthIndex } from "./util"
|
||||
|
||||
const processor = unified() // interface for remark and rehype
|
||||
|
|
|
@ -2,9 +2,9 @@ import { contentMap } from ".."
|
|||
import { contentDirectoryPath } from "../config"
|
||||
import { generateToc } from "../parseMarkdown"
|
||||
import { addDocument } from "../searchIndex"
|
||||
import { PostData } from "../types/types"
|
||||
import type { PostData } from "../types/types"
|
||||
import { writeToFile } from "../util"
|
||||
import { DataToPass } from "."
|
||||
import type { DataToPass } from "."
|
||||
|
||||
export default async function parsePost(data: DataToPass): Promise<void> {
|
||||
const {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { portfolioData } from ".."
|
|||
import { contentDirectoryPath, iconsDirectoryPath } from "../config"
|
||||
import { generateToc } from "../parseMarkdown"
|
||||
import { writeToFile } from "../util"
|
||||
import { DataToPass } from "."
|
||||
import type { DataToPass } from "."
|
||||
|
||||
export default async function parseProjects({
|
||||
urlPath,
|
||||
|
|
|
@ -2,9 +2,9 @@ import { contentMap, seriesMap } from ".."
|
|||
import { contentDirectoryPath } from "../config"
|
||||
import { generateToc } from "../parseMarkdown"
|
||||
import { addDocument } from "../searchIndex"
|
||||
import { PostData } from "../types/types"
|
||||
import type { PostData } from "../types/types"
|
||||
import { writeToFile } from "../util"
|
||||
import { DataToPass } from "."
|
||||
import type { DataToPass } from "."
|
||||
|
||||
export default async function parseSeries(data: DataToPass): Promise<void> {
|
||||
const {
|
||||
|
|
|
@ -22,6 +22,7 @@ module.exports = {
|
|||
"import/no-duplicates": "error",
|
||||
|
||||
// typescript stuff
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off", // https://typescript-eslint.io/rules/no-non-null-assertion
|
||||
"@typescript-eslint/consistent-type-imports": "error", // https://typescript-eslint.io/rules/consistent-type-imports
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue