From 400705150e6e1288ea9c0186f56cb2160672b12d Mon Sep 17 00:00:00 2001 From: Bezula Date: Sat, 31 Jul 2021 09:46:20 +0200 Subject: [PATCH] =?UTF-8?q?T2316=20-=20Poprawione=20b=C5=82=C4=99dy=20lint?= =?UTF-8?q?era?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: T2316 Test Plan: Wykonać komendę arc lint, powinno wyświetlić okey Reviewers: #testers, kuba-orlik Reviewed By: #testers, kuba-orlik Subscribers: jenkins-user Maniphest Tasks: T2316 Differential Revision: https://hub.sealcode.org/D1150 --- .prettierrc | 24 ++++++++++++------------ src/back/frame.ts | 2 +- src/back/html.ts | 2 +- src/back/routes/homepage.ts | 2 +- src/back/views/tasks.ts | 7 ++++--- src/front/controllers/task_controller.ts | 6 ++++-- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.prettierrc b/.prettierrc index 585b712..42f80e6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,14 +1,14 @@ { - useTabs: true, - tabWidth: 4, - trailingComma: "es5", - "overrides": [ - { - "files": "*.yml", - "options": { - "tabWidth": 2, - "useTabs": false - } - } - ] + "useTabs": true, + "tabWidth": 4, + "trailingComma": "es5", + "overrides": [ + { + "files": "*.yml", + "options": { + "tabWidth": 2, + "useTabs": false + } + } + ] } diff --git a/src/back/frame.ts b/src/back/frame.ts index 4a0ad5b..60563cf 100644 --- a/src/back/frame.ts +++ b/src/back/frame.ts @@ -1,3 +1,3 @@ -export default function frame(id: string, body: string) { +export default function frame(id: string, body: string): string { return /* HTML */ ` ${body} `; } diff --git a/src/back/html.ts b/src/back/html.ts index 520ee28..7460965 100644 --- a/src/back/html.ts +++ b/src/back/html.ts @@ -1,7 +1,7 @@ import { Context } from "sealious"; export default async function html( - context: Context, + _context: Context, body: string ): Promise { return /* HTML */ ` diff --git a/src/back/routes/homepage.ts b/src/back/routes/homepage.ts index 0512990..56df810 100644 --- a/src/back/routes/homepage.ts +++ b/src/back/routes/homepage.ts @@ -5,7 +5,7 @@ import { NewTask, TaskList } from "../views/tasks"; const router = new Router(); -export async function MainView(context: Context) { +export async function MainView(context: Context): Promise { return await html( context, /* HTML */ `My ToDo App diff --git a/src/back/views/tasks.ts b/src/back/views/tasks.ts index 468c3bc..091ba1b 100644 --- a/src/back/views/tasks.ts +++ b/src/back/views/tasks.ts @@ -1,7 +1,8 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { CollectionItem, Context } from "sealious"; import frame from "../frame"; -export function Task(task: CollectionItem) { +export function Task(task: CollectionItem): string { return frame( `task-${task.id}`, /* HTML */ `
  • @@ -24,7 +25,7 @@ export function Task(task: CollectionItem) { ); } -export async function TaskList(context: Context) { +export async function TaskList(context: Context): Promise { const { items: tasks } = await context.app.collections.tasks .list(context) .fetch(); @@ -38,7 +39,7 @@ export async function TaskList(context: Context) { ); } -export function NewTask() { +export function NewTask(): string { return frame( "new-task", /* HTML */ `
    { await fetch(`/api/v1/collections/tasks/${this.id}`, { method: "PATCH", headers: {