Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeephile committed Feb 17, 2025
1 parent ad816df commit 07c3036
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
16 changes: 5 additions & 11 deletions src/init/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
afterEach,
describe,
expect,
it,
vi,
} from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";

import inquire from "inquirer";

Expand All @@ -28,9 +22,9 @@ describe("initAction", () => {
vi.mocked(inquire.prompt).mockResolvedValue(promptInputs);

await initAction({
name: '',
viewType: '',
endpointUrl: '',
name: "",
viewType: "",
endpointUrl: "",
});

expect(inquire.prompt).toHaveBeenCalled();
Expand Down Expand Up @@ -58,4 +52,4 @@ describe("initAction", () => {
},
]);
});
});
});
15 changes: 9 additions & 6 deletions src/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async function makeOptions(options: CreateAppOptions) {
});
}

const promptInputs = await inquirer.prompt<{ [key: string]: string; }>(
promptItems
const promptInputs = await inquirer.prompt<{ [key: string]: string }>(
promptItems,
);

options.channelId = promptInputs.channelId ?? options.channelId;
Expand All @@ -54,7 +54,7 @@ async function makeOptions(options: CreateAppOptions) {
? promptInputs.endpointUrl
: DEFAULT_ENDPOINT_URL;

return options
return options;
}

export const initAction: (options: CreateAppOptions) => Promise<void> = async (
Expand All @@ -70,9 +70,12 @@ export const initAction: (options: CreateAppOptions) => Promise<void> = async (
const liffId = await createLiffApp(consolidatedOptions);

// 3. create liff app (@ client)
execSync(`npx @line/create-liff-app ${consolidatedOptions.name} -l ${liffId}`, {
stdio: "inherit",
});
execSync(
`npx @line/create-liff-app ${consolidatedOptions.name} -l ${liffId}`,
{
stdio: "inherit",
},
);

// 4. print instructions on how to run locally
console.info(`App ${liffId} successfully created.
Expand Down

0 comments on commit 07c3036

Please sign in to comment.