T2316 - Poprawione błędy lintera
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
This commit is contained in:
parent
4235a11d44
commit
400705150e
24
.prettierrc
24
.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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
export default function frame(id: string, body: string) {
|
||||
export default function frame(id: string, body: string): string {
|
||||
return /* HTML */ `<turbo-frame id="${id}"> ${body} </turbo-frame>`;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Context } from "sealious";
|
||||
|
||||
export default async function html(
|
||||
context: Context,
|
||||
_context: Context,
|
||||
body: string
|
||||
): Promise<string> {
|
||||
return /* HTML */ `<!DOCTYPE html>
|
||||
|
@ -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<string> {
|
||||
return await html(
|
||||
context,
|
||||
/* HTML */ `<title>My ToDo App</title>
|
||||
|
@ -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<any>) {
|
||||
export function Task(task: CollectionItem<never>): string {
|
||||
return frame(
|
||||
`task-${task.id}`,
|
||||
/* HTML */ `<li class="task">
|
||||
@ -24,7 +25,7 @@ export function Task(task: CollectionItem<any>) {
|
||||
);
|
||||
}
|
||||
|
||||
export async function TaskList(context: Context) {
|
||||
export async function TaskList(context: Context): Promise<string> {
|
||||
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 */ `<form
|
||||
|
@ -1,13 +1,15 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { Controller } from "stimulus";
|
||||
|
||||
export default class TaskController extends Controller {
|
||||
id: string;
|
||||
|
||||
connect() {
|
||||
connect(): void {
|
||||
this.id = this.element.attributes["data-id"].value;
|
||||
}
|
||||
|
||||
async toggle(event: Event) {
|
||||
async toggle(event: Event): Promise<void> {
|
||||
await fetch(`/api/v1/collections/tasks/${this.id}`, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user