Skip to content

Commit bbe9b01

Browse files
committed
chore: lint
1 parent 852474b commit bbe9b01

File tree

42 files changed

+1049
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1049
-976
lines changed

content/ja/9.workspace/1.todo-list/.template/files/app.vue

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, computed } from 'vue';
2+
import { computed, ref } from 'vue'
33
import TodoList from './components/TodoList.vue'
44
55
/**
@@ -9,20 +9,20 @@ const todos = ref<Todo[]>([
99
{
1010
id: 1,
1111
done: false,
12-
title: "Vue Fes Japan 2025のチケット販売開始の宣伝をする",
13-
note: "XとBlueskyで宣伝する。\n会社のslackでも宣伝する。",
14-
dueDate: "2025-10-24",
12+
title: 'Vue Fes Japan 2025のチケット販売開始の宣伝をする',
13+
note: 'XとBlueskyで宣伝する。\n会社のslackでも宣伝する。',
14+
dueDate: '2025-10-24',
1515
},
1616
{
1717
id: 2,
1818
done: true,
19-
title: "Vue Fes Japan ボランティアスタッフに応募する",
20-
note: "",
21-
dueDate: "",
19+
title: 'Vue Fes Japan ボランティアスタッフに応募する',
20+
note: '',
21+
dueDate: '',
2222
},
23-
]);
24-
const showUnDoneOnly = ref(false);
25-
const isCreateModalOpen = ref(false);
23+
])
24+
const showUnDoneOnly = ref(false)
25+
const isCreateModalOpen = ref(false)
2626
const inputTitile = ref('')
2727
const inputNote = ref('')
2828
const inputDate = ref('')
@@ -32,48 +32,48 @@ const inputDate = ref('')
3232
*/
3333
const filteredTodos = computed(() => {
3434
if (!showUnDoneOnly.value) {
35-
return todos.value;
35+
return todos.value
3636
}
3737
38-
return todos.value.filter(todo => !todo.done);
39-
});
38+
return todos.value.filter(todo => !todo.done)
39+
})
4040
4141
/**
4242
* Methods
4343
*/
44-
const updateDone = (id: number, done: boolean) => {
44+
function updateDone(id: number, done: boolean) {
4545
const targetTodo = todos.value.find(todo => todo.id === id)
4646
4747
if (targetTodo) {
4848
targetTodo.done = done
4949
}
5050
}
5151
52-
const handleSubmit = () => {
52+
function handleSubmit() {
5353
const newTodo: Todo = {
5454
id: Date.now(),
5555
done: false,
5656
title: inputTitile.value,
5757
note: inputNote.value,
58-
dueDate: inputDate.value
58+
dueDate: inputDate.value,
5959
}
6060
6161
todos.value = [
6262
newTodo,
63-
...todos.value
63+
...todos.value,
6464
]
6565
}
6666
6767
/**
6868
* Type
6969
*/
70-
type Todo = {
71-
id: number;
72-
done: boolean;
73-
title: string;
74-
note: string;
75-
dueDate: string;
76-
};
70+
interface Todo {
71+
id: number
72+
done: boolean
73+
title: string
74+
note: string
75+
dueDate: string
76+
}
7777
</script>
7878

7979
<template>
@@ -96,16 +96,17 @@ type Todo = {
9696
<input
9797
v-model="showUnDoneOnly"
9898
type="checkbox"
99-
/>
99+
>
100100
未完了のみ表示
101101
</label>
102102
</div>
103103
</div>
104-
<button type="button" @click="isCreateModalOpen = true">新規作成</button>
104+
<button type="button" @click="isCreateModalOpen = true">
105+
新規作成
106+
</button>
105107
</div>
106108

107-
<TodoList :todos="filteredTodos" @update-done="updateDone"/>
108-
109+
<TodoList :todos="filteredTodos" @update-done="updateDone" />
109110

110111
<!-- 新規作成モーダル -->
111112
<CreateModal
@@ -115,7 +116,7 @@ type Todo = {
115116
<form>
116117
<div>
117118
<label for="title">タイトル</label>
118-
<input id="title" v-model="inputTitile" type="text" required />
119+
<input id="title" v-model="inputTitile" type="text" required>
119120
</div>
120121

121122
<div>
@@ -125,11 +126,13 @@ type Todo = {
125126

126127
<div>
127128
<label for="dueDate">期限</label>
128-
<input id="dueDate" v-model="inputDate" type="date" />
129+
<input id="dueDate" v-model="inputDate" type="date">
129130
</div>
130131

131132
<div>
132-
<button type="button" @click="handleSubmit">登録</button>
133+
<button type="button" @click="handleSubmit">
134+
登録
135+
</button>
133136
</div>
134137
</form>
135138
</CreateModal>
@@ -209,13 +212,13 @@ button {
209212
border-radius: 0.375rem;
210213
border: none;
211214
font-size: 0.875rem;
212-
background-color: #02C169;
215+
background-color: #02c169;
213216
color: #fff;
214217
cursor: pointer;
215218
}
216219
217220
button:hover {
218-
background-color: #029E58;
221+
background-color: #029e58;
219222
}
220223
/* ------- actions last ------- */
221224

content/ja/9.workspace/1.todo-list/.template/files/components/CreateModal.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<script setup lang="ts">
2-
32
/**
43
* DefineModel
54
*/
65
const isCreateModalOpen = defineModel()
7-
86
</script>
97

108
<template>
@@ -63,18 +61,17 @@ const isCreateModalOpen = defineModel()
6361
font-weight: bold;
6462
}
6563
66-
6764
button {
6865
padding: 0.375rem 1rem;
6966
border-radius: 0.375rem;
7067
border: none;
7168
font-size: 0.875rem;
72-
background-color: #02C169;
69+
background-color: #02c169;
7370
color: #fff;
7471
cursor: pointer;
7572
}
7673
7774
button:hover {
78-
background-color: #029E58;
75+
background-color: #029e58;
7976
}
8077
</style>

content/ja/9.workspace/1.todo-list/.template/files/components/TodoList.vue

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,60 @@ defineProps<{
1010
* Emit
1111
*/
1212
const emit = defineEmits<{
13-
'update-done': [number, boolean]
13+
updateDone: [number, boolean]
1414
}>()
1515
1616
/**
1717
* Types
1818
*/
19-
type Todo = {
20-
id: number;
21-
done: boolean;
22-
title: string;
23-
note: string;
24-
dueDate: string;
25-
};
19+
interface Todo {
20+
id: number
21+
done: boolean
22+
title: string
23+
note: string
24+
dueDate: string
25+
}
2626
</script>
2727

2828
<template>
29-
<table class="todo-table">
30-
<thead>
31-
<tr>
32-
<th>完了</th>
33-
<th>タイトル</th>
34-
<th>メモ</th>
35-
<th>期限</th>
36-
</tr>
37-
</thead>
38-
<tbody>
39-
<tr v-for="todo in todos" :key="todo.id">
40-
<td class="text-center">
41-
<button
42-
v-if="todo.done" type="button"
43-
class="button-icon"
44-
@click="emit('update-done', todo.id, false)"
45-
>
46-
47-
</button>
48-
<button
49-
v-else
50-
type="button"
51-
class="button-icon"
52-
@click="emit('update-done', todo.id, true)"
53-
>
54-
55-
</button>
56-
</td>
57-
<td>{{ todo.title }}</td>
58-
<td><div class="multiline">{{ todo.note }}</div></td>
59-
<td>{{ todo.dueDate }}</td>
60-
</tr>
61-
</tbody>
62-
</table>
29+
<table class="todo-table">
30+
<thead>
31+
<tr>
32+
<th>完了</th>
33+
<th>タイトル</th>
34+
<th>メモ</th>
35+
<th>期限</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
<tr v-for="todo in todos" :key="todo.id">
40+
<td class="text-center">
41+
<button
42+
v-if="todo.done" type="button"
43+
class="button-icon"
44+
@click="emit('updateDone', todo.id, false)"
45+
>
46+
47+
</button>
48+
<button
49+
v-else
50+
type="button"
51+
class="button-icon"
52+
@click="emit('updateDone', todo.id, true)"
53+
>
54+
55+
</button>
56+
</td>
57+
<td>{{ todo.title }}</td>
58+
<td>
59+
<div class="multiline">
60+
{{ todo.note }}
61+
</div>
62+
</td>
63+
<td>{{ todo.dueDate }}</td>
64+
</tr>
65+
</tbody>
66+
</table>
6367
</template>
6468

6569
<style scoped>

content/ja/9.workspace/1.todo-list/2.reactivity-1/.template/files/app.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<script setup lang="ts">
2-
32
/**
43
* Data
54
*/
65
// TODO: リアクティブな値に変更
7-
let userName = "No Name";
6+
let userName = 'No Name'
87
98
/**
109
* Methods
1110
*/
1211
// TODO: リアクティブな値にアクセスできるよう変更
13-
const setUserName = () => {
12+
function setUserName() {
1413
userName = 'Vue Fes Japan'
1514
}
1615
</script>
@@ -22,7 +21,9 @@ const setUserName = () => {
2221
<h1>Vue TODO Application</h1>
2322
</div>
2423
<div class="header-right">
25-
<button @click="setUserName">ユーザー名をセット</button>
24+
<button @click="setUserName">
25+
ユーザー名をセット
26+
</button>
2627
👤
2728
<span>{{ userName }}</span>
2829
</div>
@@ -38,8 +39,7 @@ const setUserName = () => {
3839
<th>期限</th>
3940
</tr>
4041
</thead>
41-
<tbody>
42-
</tbody>
42+
<tbody />
4343
</table>
4444
</main>
4545

@@ -88,7 +88,6 @@ const setUserName = () => {
8888
}
8989
/* ------- header last ------- */
9090
91-
9291
/* ------- main start ------- */
9392
main {
9493
flex-grow: 1;
@@ -113,7 +112,7 @@ main {
113112
justify-content: start;
114113
}
115114
116-
.search-area input[type="search"] {
115+
.search-area input[type='search'] {
117116
padding: 0.25rem 0.5rem;
118117
font-size: 0.875rem;
119118
border: 1px solid #ccc;
@@ -133,7 +132,7 @@ main {
133132
border-radius: 0.375rem;
134133
border: none;
135134
font-size: 0.875rem;
136-
background-color: #02C169;
135+
background-color: #02c169;
137136
color: #fff;
138137
cursor: pointer;
139138
}
@@ -232,7 +231,7 @@ main {
232231
border-radius: 0.375rem;
233232
border: none;
234233
font-size: 0.875rem;
235-
background-color: #02C169;
234+
background-color: #02c169;
236235
color: #fff;
237236
cursor: pointer;
238237
}

0 commit comments

Comments
 (0)