Skip to content

Remove unused variables #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions src/client/components/SidebarContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/client/templates/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 1 addition & 5 deletions src/commands/login.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 1 addition & 5 deletions src/commands/preview.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
3 changes: 1 addition & 2 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
3 changes: 0 additions & 3 deletions src/commands/pull.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
1 change: 0 additions & 1 deletion src/lib/file-system-repo.test.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/file-system-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions src/server/api/readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function startServer() {
: 8888;
const host = "localhost";

return new Promise<Server>((resolve, reject) => {
return new Promise<Server>((resolve) => {
server
.listen(port, host)
.once("listening", () => {
Expand Down
2 changes: 0 additions & 2 deletions src/server/lib/get-current-user.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down