Skip to content

Commit

Permalink
noAssignInExpressionsをOFFにしてhoursを再代入する
Browse files Browse the repository at this point in the history
  • Loading branch information
yamanoku committed Apr 16, 2024
1 parent de09d9b commit 6e66f39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/islands/counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export default function Counter(props: InitialTime) {
);
const days = Math.floor(diffInSeconds / (60 * 60 * 24));
// hoursを日本時間の24時間計算になるようにする
const hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9;
hours < 0 ? hours + 24 : hours;
let hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9;
hours < 0 ? (hours = hours + 24) : hours;
const minutes = Math.floor((diffInSeconds / 60) % 60);
const seconds = diffInSeconds % 60;

Expand Down
4 changes: 2 additions & 2 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function Index() {
const diffInSeconds = Math.floor((Number(nextBirthday) - Number(now)) / 1000);
const days = Math.floor(diffInSeconds / (60 * 60 * 24));
// hoursを日本時間の24時間計算になるようにする
const hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9;
hours < 0 ? hours + 24 : hours;
let hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9;
hours < 0 ? (hours = hours + 24) : hours;
const minutes = Math.floor((diffInSeconds / 60) % 60);
const seconds = diffInSeconds % 60;

Expand Down
5 changes: 4 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
}

0 comments on commit 6e66f39

Please sign in to comment.