diff --git a/.eslintrc.js b/.eslintrc.js index f25bb32..d7bf6bb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,25 +25,6 @@ module.exports = { // TODO overrides: [ - { - rules: { - "@typescript-eslint/no-unused-vars": "off", - }, - files: [ - "src/client/components/Article.tsx", - "src/client/components/SidebarContents.tsx", - "src/client/templates/Sidebar.tsx", - "src/commands/login.ts", - "src/commands/preview.ts", - "src/commands/publish.ts", - "src/commands/pull.ts", - "src/lib/file-system-repo.test.ts", - "src/lib/file-system-repo.ts", - "src/server/api/readme.ts", - "src/server/app.ts", - "src/server/lib/get-current-user.ts", - ], - }, { rules: { "react-hooks/exhaustive-deps": "off", diff --git a/src/client/components/SidebarContents.tsx b/src/client/components/SidebarContents.tsx index 7baac43..9abc9df 100644 --- a/src/client/components/SidebarContents.tsx +++ b/src/client/components/SidebarContents.tsx @@ -558,12 +558,6 @@ const mobileSidebarStyle = (isStateOpen: boolean) => zIndex: 10, }); -const articlesMobileListStyle = css({ - overflow: "hidden", - padding: `0 ${getSpace(5 / 2)}px 0 ${getSpace(2)}px`, - boxSizing: "border-box", -}); - const headerStyle = css({ alignItems: "center", fontSize: Typography.subhead1, diff --git a/src/client/templates/Sidebar.tsx b/src/client/templates/Sidebar.tsx index f9a4a16..175c2a8 100644 --- a/src/client/templates/Sidebar.tsx +++ b/src/client/templates/Sidebar.tsx @@ -1,7 +1,6 @@ import { css } from "@emotion/react"; import type { ReactNode } from "react"; import { Colors } from "../lib/variables"; -import { viewport } from "../lib/mixins"; interface Props { children?: ReactNode; diff --git a/src/commands/login.ts b/src/commands/login.ts index c386dad..ad1ab89 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -1,13 +1,9 @@ -import arg from "arg"; import process from "node:process"; import readline from "node:readline/promises"; import { config } from "../lib/config"; import { getQiitaApiInstance } from "../lib/get-qiita-api-instance"; -import { QiitaApi } from "../qiita-api"; - -export const login = async (argv: string[]) => { - const args = arg({}, { argv }); +export const login = async () => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, diff --git a/src/commands/preview.ts b/src/commands/preview.ts index 423abe6..14ab2c0 100644 --- a/src/commands/preview.ts +++ b/src/commands/preview.ts @@ -1,14 +1,10 @@ -import arg from "arg"; import { config } from "../lib/config"; import { getFileSystemRepo } from "../lib/get-file-system-repo"; import { getQiitaApiInstance } from "../lib/get-qiita-api-instance"; import { syncArticlesFromQiita } from "../lib/sync-articles-from-qiita"; -import { QiitaApi } from "../qiita-api"; import { startLocalChangeWatcher, startServer } from "../server/app"; -export const preview = async (argv: string[]) => { - const args = arg({}, { argv }); - +export const preview = async () => { const qiitaApi = await getQiitaApiInstance(); const fileSystemRepo = await getFileSystemRepo(); diff --git a/src/commands/publish.ts b/src/commands/publish.ts index 2a8d90e..1bf66fb 100644 --- a/src/commands/publish.ts +++ b/src/commands/publish.ts @@ -1,13 +1,12 @@ import arg from "arg"; import process from "node:process"; import { checkFrontmatterType } from "../lib/check-frontmatter-type"; -import { config } from "../lib/config"; import { QiitaItem } from "../lib/entities/qiita-item"; import { getFileSystemRepo } from "../lib/get-file-system-repo"; import { getQiitaApiInstance } from "../lib/get-qiita-api-instance"; import { syncArticlesFromQiita } from "../lib/sync-articles-from-qiita"; import { validateItem } from "../lib/validators/item-validator"; -import { Item, QiitaApi } from "../qiita-api"; +import { Item } from "../qiita-api"; export const publish = async (argv: string[]) => { const args = arg( diff --git a/src/commands/pull.ts b/src/commands/pull.ts index f22aeca..a88f9f3 100644 --- a/src/commands/pull.ts +++ b/src/commands/pull.ts @@ -1,10 +1,7 @@ import arg from "arg"; -import { config } from "../lib/config"; import { getFileSystemRepo } from "../lib/get-file-system-repo"; import { getQiitaApiInstance } from "../lib/get-qiita-api-instance"; import { syncArticlesFromQiita } from "../lib/sync-articles-from-qiita"; -import { QiitaApi } from "../qiita-api"; -import { startLocalChangeWatcher, startServer } from "../server/app"; export const pull = async (argv: string[]) => { const args = arg( diff --git a/src/lib/file-system-repo.test.ts b/src/lib/file-system-repo.test.ts index a0bcfaf..8e94e77 100644 --- a/src/lib/file-system-repo.test.ts +++ b/src/lib/file-system-repo.test.ts @@ -1,5 +1,4 @@ import matter from "gray-matter"; -import { Dirent } from "node:fs"; import fs from "node:fs/promises"; import { Item } from "../qiita-api"; import { FileSystemRepo } from "./file-system-repo"; diff --git a/src/lib/file-system-repo.ts b/src/lib/file-system-repo.ts index 2dc85c1..979a5b8 100644 --- a/src/lib/file-system-repo.ts +++ b/src/lib/file-system-repo.ts @@ -201,7 +201,7 @@ export class FileSystemRepo { ); } - private defaultBasename(fileContent: FileContent, _remote: boolean) { + private defaultBasename(fileContent: FileContent) { // TODO: Add article title to basename return fileContent.id as string; } @@ -239,7 +239,7 @@ export class FileSystemRepo { return; } const filepath = this.getFilePath( - basename || this.defaultBasename(fileContent, remote), + basename || this.defaultBasename(fileContent), remote ); const data = fileContent.toSaveFormat(); diff --git a/src/server/api/readme.ts b/src/server/api/readme.ts index 710325d..91de1b7 100644 --- a/src/server/api/readme.ts +++ b/src/server/api/readme.ts @@ -2,9 +2,7 @@ import type Express from "express"; import { Router } from "express"; import fs from "node:fs/promises"; import path from "node:path"; -import { config } from "../../lib/config"; import { getQiitaApiInstance } from "../../lib/get-qiita-api-instance"; -import { QiitaApi } from "../../qiita-api"; const readmeIndex = async (req: Express.Request, res: Express.Response) => { try { diff --git a/src/server/app.ts b/src/server/app.ts index ced45db..d7745e1 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -35,7 +35,7 @@ export async function startServer() { : 8888; const host = "localhost"; - return new Promise((resolve, reject) => { + return new Promise((resolve) => { server .listen(port, host) .once("listening", () => { diff --git a/src/server/lib/get-current-user.ts b/src/server/lib/get-current-user.ts index efe199e..7277fb9 100644 --- a/src/server/lib/get-current-user.ts +++ b/src/server/lib/get-current-user.ts @@ -1,6 +1,4 @@ -import { config } from "../../lib/config"; import { getQiitaApiInstance } from "../../lib/get-qiita-api-instance"; -import { QiitaApi } from "../../qiita-api"; let currentUser: { id: string } | undefined;