Skip to content

Commit d0b49aa

Browse files
committed
Fix lint
1 parent b086b57 commit d0b49aa

16 files changed

Lines changed: 63 additions & 39 deletions

File tree

configs/eslint/defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ module.exports = {
7272
message: "Switch cases without blocks are disallowed.",
7373
},
7474
{
75-
selector: "CallExpression[callee.property.name='catch'] MemberExpression[object.name='console']",
76-
message: "Don't do .catch(console.error). Please handle errors explicitly, eg. with runAsynchronously<WithAlert> or process.exit(1).",
75+
selector: "CallExpression[callee.property.name='catch']:has(MemberExpression[object.name='console'])",
76+
message: "Don't do .catch(console.error). Please handle errors explicitly, eg. with runAsynchronously or runAsynchronouslyWithAlert.",
7777
},
7878
{
7979
selector:

docs/src/components/api/enhanced-api-page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,12 @@ export function EnhancedAPIPage({ document, operations, description }: EnhancedA
335335
requestState={requestState}
336336
setRequestState={setRequestState}
337337
onExecute={() => {
338+
// eslint-disable-next-line no-restricted-syntax
338339
executeRequest(operation, path, method)
339340
.catch(error => console.error('Failed to execute request:', error));
340341
}}
341342
onCopy={(text: string) => {
343+
// eslint-disable-next-line no-restricted-syntax
342344
copyToClipboard(text)
343345
.catch(error => console.error('Failed to copy to clipboard:', error));
344346
}}
@@ -665,6 +667,7 @@ function ModernAPIPlayground({
665667
variant="outline"
666668
size="sm"
667669
onClick={() => {
670+
// eslint-disable-next-line no-restricted-syntax
668671
handleCopy(getCodeExample())
669672
.catch(error => {
670673
console.error('Failed to copy code example', error);

docs/src/components/api/webhooks-api-page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export function WebhooksAPIPage({ document, webhooks, description }: WebhooksAPI
167167
method={method.toUpperCase()}
168168
spec={spec}
169169
onCopy={(text: string) => {
170+
// eslint-disable-next-line no-restricted-syntax
170171
copyToClipboard(text)
171172
.catch(error => console.error('Failed to copy to clipboard:', error));
172173
}}
@@ -408,6 +409,7 @@ def handle_webhook():
408409
}
409410
};
410411

412+
// eslint-disable-next-line no-restricted-syntax
411413
updateHighlightedCode().catch(error => {
412414
console.error('Error updating highlighted code:', error);
413415
});
@@ -513,6 +515,7 @@ def handle_webhook():
513515
variant="outline"
514516
size="sm"
515517
onClick={() => {
518+
// eslint-disable-next-line no-restricted-syntax
516519
handleCopy(getCodeExample())
517520
.catch(error => {
518521
console.error('Failed to copy code example', error);

docs/src/components/apple-secret-generator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const Input = ({
100100
<button
101101
type="button"
102102
onClick={() => {
103+
// eslint-disable-next-line no-restricted-syntax
103104
handleCopy().catch((error) => {
104105
console.error('Failed to copy:', error);
105106
});
@@ -270,6 +271,7 @@ const AppleSecretGenerator = () => {
270271
color="primary"
271272
disabled={!(teamID.length === 10 && serviceID && file)}
272273
onClick={() => {
274+
// eslint-disable-next-line no-restricted-syntax
273275
(async () => {
274276
setError('');
275277

docs/src/components/chat/ai-chat.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export function AIChatDrawer() {
167167
}
168168
};
169169

170+
// eslint-disable-next-line no-restricted-syntax
170171
fetchDocs().catch((error) => {
171172
console.error('Failed to fetch documentation:', error);
172173
});
@@ -198,6 +199,7 @@ export function AIChatDrawer() {
198199
},
199200
onFinish: (message) => {
200201
// Send AI response to Discord
202+
// eslint-disable-next-line no-restricted-syntax
201203
sendAIResponseToDiscord(message.content).catch(error => {
202204
console.error('Failed to send AI response to Discord:', error);
203205
});
@@ -275,6 +277,7 @@ export function AIChatDrawer() {
275277
}));
276278

277279
// Send message to Discord webhook
280+
// eslint-disable-next-line no-restricted-syntax
278281
sendToDiscord(input.trim()).catch(error => {
279282
console.error('Discord webhook error:', error);
280283
});
@@ -285,6 +288,7 @@ export function AIChatDrawer() {
285288

286289
// Non-async wrapper for form onSubmit to avoid promise issues
287290
const handleFormSubmit = (e: React.FormEvent) => {
291+
// eslint-disable-next-line no-restricted-syntax
288292
handleChatSubmit(e).catch(error => {
289293
console.error('Chat submit error:', error);
290294
});
@@ -294,6 +298,7 @@ export function AIChatDrawer() {
294298
const handleKeyDown = (e: React.KeyboardEvent) => {
295299
if (e.key === 'Enter' && !e.shiftKey) {
296300
e.preventDefault();
301+
// eslint-disable-next-line no-restricted-syntax
297302
handleChatSubmit(e as React.FormEvent).catch(error => {
298303
console.error('Chat submit error:', error);
299304
});

docs/src/components/chat/compact-codeblock.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function CompactCodeblock({ code, language = 'tsx', maxHeight = '200px',
4545
}
4646
};
4747

48+
// eslint-disable-next-line no-restricted-syntax
4849
highlightCode().catch((error) => {
4950
console.error('Error highlighting code:', error);
5051
});
@@ -55,6 +56,7 @@ export function CompactCodeblock({ code, language = 'tsx', maxHeight = '200px',
5556
}, [code, language]);
5657

5758
const handleCopy = () => {
59+
// eslint-disable-next-line no-restricted-syntax
5860
void navigator.clipboard.writeText(code).then(() => {
5961
setCopied(true);
6062
setTimeout(() => setCopied(false), 2000);

docs/src/components/chat/message-formatter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ export function MessageFormatter({ content, className = '' }: MessageFormatterPr
312312
}
313313
};
314314

315+
// eslint-disable-next-line no-restricted-syntax
315316
parseContent().catch((error) => {
316317
console.error('Error parsing markdown:', error);
317318
});

docs/src/components/layout/custom-search-dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export function CustomSearchDialog({ open, onOpenChange }: CustomSearchDialogPro
189189
}
190190

191191
searchTimeoutRef.current = setTimeout(() => {
192+
// eslint-disable-next-line no-restricted-syntax
192193
performSearch(query).catch((error) => {
193194
console.error('Search failed:', error);
194195
});

docs/src/components/mdx/dynamic-code-block.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export function DynamicCodeblock({ code, language = 'tsx', title }: DynamicCodeb
4141
}
4242
};
4343

44+
// eslint-disable-next-line no-restricted-syntax
4445
updateHighlightedCode().catch(error => {
4546
console.error('Error updating highlighted code:', error);
4647
});

docs/src/components/mdx/mermaid.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export function Mermaid({ chart }: { chart: string }) {
4444
}
4545
}
4646

47+
// eslint-disable-next-line no-restricted-syntax
4748
renderChart().catch(error => {
4849
console.error('Failed to render Mermaid chart:', error);
4950
});

0 commit comments

Comments
 (0)