-
Notifications
You must be signed in to change notification settings - Fork 0
chore(eslint): fix 21 quick-win errors (Onda 5 PR 5.1) #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,6 +49,7 @@ export function useActionFeedback() { | |||||||||
| return new Promise((resolve) => { | ||||||||||
| const { description, undoDuration = 5000, onUndo, onConfirm } = options; | ||||||||||
| let undone = false; | ||||||||||
| // eslint-disable-next-line prefer-const -- closure: assigned at line 57 after toast definition uses it | ||||||||||
|
|
||||||||||
| let timeoutId: NodeJS.Timeout; | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verifica se o projeto usa NodeJS.Timeout em código de frontend e como o TS está configurado.
echo "== Procurando tsconfig* =="
fd -i '^tsconfig.*\.json$'
echo
echo "== libs/types nos tsconfig* =="
fd -i '^tsconfig.*\.json$' -x sh -c 'echo "--- $1"; sed -n "1,220p" "$1" | rg -n "\"lib\"|\"types\"|dom|node" -n -C2' sh {}
echo
echo "== Ocorrências de NodeJS.Timeout em src =="
rg -n --type ts --type tsx '\bNodeJS\.Timeout\b' src
echo
echo "== Padrão recomendado já existente (ReturnType<typeof setTimeout>) =="
rg -n --type ts --type tsx 'ReturnType<\s*typeof\s+setTimeout\s*>' srcRepository: adm01-debug/zapp-web Length of output: 856 🏁 Script executed: cat -n src/hooks/useActionFeedback.ts | sed -n '48,62p'Repository: adm01-debug/zapp-web Length of output: 1153 🏁 Script executed: #!/bin/bash
echo "== Buscando setTimeout/setInterval/clearTimeout em src =="
rg '(setTimeout|setInterval|clearTimeout|clearInterval)' src -B2 -A2 --no-heading | head -100
echo
echo "== Procurando tipagens de timeout em src =="
rg 'Timeout|ReturnType.*setTimeout' src -n --no-heading | head -50Repository: adm01-debug/zapp-web Length of output: 10241 Padronize tipagem de timeout com O projeto estabelece padrão em - let timeoutId: NodeJS.Timeout;
+ let timeoutId: ReturnType<typeof setTimeout>;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| const toastResult = showFeedback('info', { | ||||||||||
| description, duration: undoDuration, | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -112,7 +112,7 @@ export function sanitizeDisplayName(name: string, maxLength = 100): string { | |||||
| export function sanitizeJid(jid: string): string | null { | ||||||
| // Individual: 5511999999999@s.whatsapp.net | ||||||
| // Group: 120363XXXX@g.us | ||||||
| const jidPattern = /^[\d\-]+@(s\.whatsapp\.net|g\.us|lid|newsletter)$/; | ||||||
| const jidPattern = /^[\d-]+@(s\.whatsapp\.net|g\.us|lid|newsletter)$/; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regex de JID permite entradas inválidas sem dígitos. Com Diff sugerido- const jidPattern = /^[\d-]+@(s\.whatsapp\.net|g\.us|lid|newsletter)$/;
+ const jidPattern = /^(?:\d+@s\.whatsapp\.net|\d+-\d+@g\.us|\d+@(?:lid|newsletter))$/;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| const trimmed = jid.trim(); | ||||||
|
|
||||||
| if (jidPattern.test(trimmed)) { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1480
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 4749
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 46
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 315
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1226
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 824
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 2142
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 765
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 4262
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1293
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 5370
Sanitização insuficiente permite injeção de filtro PostgREST
O regex atual
/[\s\-()]/gdeixa passar caracteres especiais (vírgula, aspas, ponto, etc.) que quebram a sintaxe do filtro.or(). Uma entrada como123",phone.eq.456,phone.ilike.%passa intacta, corrompendo a query.Use
/\D/gpara manter apenas dígitos (números de telefone só precisam disso):useNewConversation.ts:51:searchQuerynão tem sanitização e passa direto para.or(\name.ilike.%${searchQuery}%,phone.ilike.%${searchQuery}%`)`. Adicione validação lá também.📝 Committable suggestion
🤖 Prompt for AI Agents