Skip to content

Commit c118351

Browse files
committed
chore: lint
1 parent 7139a67 commit c118351

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: "CodeQL"
1+
name: CodeQL
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [main]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: [main]
88
schedule:
9-
- cron: "31 15 * * 5"
9+
- cron: '31 15 * * 5'
1010

1111
jobs:
1212
analyze:
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ javascript ]
23+
language: [javascript]
2424

2525
steps:
2626
- name: Checkout
@@ -38,4 +38,4 @@ jobs:
3838
- name: Perform CodeQL Analysis
3939
uses: github/codeql-action/analyze@v3
4040
with:
41-
category: "/language:${{ matrix.language }}"
41+
category: '/language:${{ matrix.language }}'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"build": "unbuild",
2121
"dev": "vitest dev",
22-
"lint": "eslint . --fix",
22+
"lint": "eslint .",
2323
"prepare": "simple-git-hooks",
2424
"prepack": "pnpm build",
2525
"prepublishOnly": "pnpm lint && pnpm test",

playground/docker/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
user: postgres
66
restart: always
77
healthcheck:
8-
test: 'pg_isready -U user --dbname=postgres'
8+
test: pg_isready -U user --dbname=postgres
99
interval: 10s
1010
timeout: 5s
1111
retries: 5
@@ -16,11 +16,11 @@ services:
1616
POSTGRES_DB: postgres
1717
POSTGRES_PASSWORD: password
1818
command: |
19-
postgres
19+
postgres
2020
-c wal_level=logical
21-
-c max_wal_senders=10
22-
-c max_replication_slots=5
23-
-c hot_standby=on
21+
-c max_wal_senders=10
22+
-c max_replication_slots=5
23+
-c hot_standby=on
2424
-c hot_standby_feedback=on
2525
volumes:
2626
- zstart_pgdata:/var/lib/postgresql/data

playground/src/app.vue

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<script setup lang="ts">
22
import { escapeLike, Zero } from '@rocicorp/zero'
3-
import { useQuery } from 'zero-vue'
4-
import { computed, ref } from 'vue'
53
import { decodeJwt } from 'jose'
64
import Cookies from 'js-cookie'
5+
import { computed, ref } from 'vue'
6+
import { useQuery } from 'zero-vue'
77
8+
import { useInterval } from '~/composables/use-interval'
89
import { randomMessage } from '~/db/data/test-data'
910
import { schema } from '~/db/schema'
10-
import { useInterval } from '~/composables/use-interval'
11-
import { randInt } from '~/utils/rand'
1211
import { formatDate } from '~/utils/date'
12+
import { randInt } from '~/utils/rand'
1313
1414
const encodedJWT = Cookies.get('jwt')
1515
const decodedJWT = encodedJWT && decodeJwt(encodedJWT)
@@ -52,7 +52,7 @@ const filteredMessages = useQuery(() => {
5252
5353
const hasFilters = computed(() => filterUser.value || filterText.value)
5454
55-
const deleteRandomMessage = () => {
55+
function deleteRandomMessage() {
5656
if (allMessages.value.length === 0) {
5757
return false
5858
}
@@ -62,12 +62,12 @@ const deleteRandomMessage = () => {
6262
return true
6363
}
6464
65-
const addRandomMessage = () => {
65+
function addRandomMessage() {
6666
z.mutate.message.insert(randomMessage(users.value, mediums.value))
6767
return true
6868
}
6969
70-
const handleAction = () => {
70+
function handleAction() {
7171
if (action.value === 'add') {
7272
return addRandomMessage()
7373
}
@@ -89,15 +89,16 @@ useInterval(
8989
9090
const INITIAL_HOLD_DELAY_MS = 300
9191
let holdTimer: number | null = null
92-
const handleAddAction = () => {
92+
function handleAddAction() {
9393
addRandomMessage()
9494
holdTimer = setTimeout(() => {
9595
action.value = 'add'
9696
}, INITIAL_HOLD_DELAY_MS)
9797
}
9898
99-
const handleRemoveAction = (e: MouseEvent | TouchEvent) => {
99+
function handleRemoveAction(e: MouseEvent | TouchEvent) {
100100
if (z.userID === 'anon' && 'shiftKey' in e && !e.shiftKey) {
101+
// eslint-disable-next-line no-alert
101102
alert('You must be logged in to delete. Hold shift to try anyway.')
102103
return
103104
}
@@ -108,7 +109,7 @@ const handleRemoveAction = (e: MouseEvent | TouchEvent) => {
108109
}, INITIAL_HOLD_DELAY_MS)
109110
}
110111
111-
const stopAction = () => {
112+
function stopAction() {
112113
if (holdTimer) {
113114
clearTimeout(holdTimer)
114115
holdTimer = null
@@ -117,22 +118,24 @@ const stopAction = () => {
117118
action.value = undefined
118119
}
119120
120-
const editMessage = (e: MouseEvent, id: string, senderID: string, prev: string) => {
121+
function editMessage(e: MouseEvent, id: string, senderID: string, prev: string) {
121122
if (senderID !== z.userID && !e.shiftKey) {
123+
// eslint-disable-next-line no-alert
122124
alert(
123125
'You aren\'t logged in as the sender of this message. Editing won\'t be permitted. Hold the shift key to try anyway.',
124126
)
125127
return
126128
}
129+
130+
// eslint-disable-next-line no-alert
127131
const body = prompt('Edit message', prev)
128132
z.mutate.message.update({
129133
id,
130134
body: body ?? prev,
131135
})
132136
}
133137
134-
const jwt = Cookies.get('jwt')
135-
const toggleLogin = async () => {
138+
async function toggleLogin() {
136139
if (z.userID === 'anon') {
137140
await fetch('/api/login')
138141
}

0 commit comments

Comments
 (0)