Fix lint
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled

This commit is contained in:
Konstantin Wohlwend 2025-08-12 18:50:53 -07:00
parent b086b57f47
commit d0b49aa124
16 changed files with 63 additions and 39 deletions

View File

@ -72,8 +72,8 @@ module.exports = {
message: "Switch cases without blocks are disallowed.",
},
{
selector: "CallExpression[callee.property.name='catch'] MemberExpression[object.name='console']",
message: "Don't do .catch(console.error). Please handle errors explicitly, eg. with runAsynchronously<WithAlert> or process.exit(1).",
selector: "CallExpression[callee.property.name='catch']:has(MemberExpression[object.name='console'])",
message: "Don't do .catch(console.error). Please handle errors explicitly, eg. with runAsynchronously or runAsynchronouslyWithAlert.",
},
{
selector:

View File

@ -335,10 +335,12 @@ export function EnhancedAPIPage({ document, operations, description }: EnhancedA
requestState={requestState}
setRequestState={setRequestState}
onExecute={() => {
// eslint-disable-next-line no-restricted-syntax
executeRequest(operation, path, method)
.catch(error => console.error('Failed to execute request:', error));
}}
onCopy={(text: string) => {
// eslint-disable-next-line no-restricted-syntax
copyToClipboard(text)
.catch(error => console.error('Failed to copy to clipboard:', error));
}}
@ -665,6 +667,7 @@ function ModernAPIPlayground({
variant="outline"
size="sm"
onClick={() => {
// eslint-disable-next-line no-restricted-syntax
handleCopy(getCodeExample())
.catch(error => {
console.error('Failed to copy code example', error);

View File

@ -167,6 +167,7 @@ export function WebhooksAPIPage({ document, webhooks, description }: WebhooksAPI
method={method.toUpperCase()}
spec={spec}
onCopy={(text: string) => {
// eslint-disable-next-line no-restricted-syntax
copyToClipboard(text)
.catch(error => console.error('Failed to copy to clipboard:', error));
}}
@ -408,6 +409,7 @@ def handle_webhook():
}
};
// eslint-disable-next-line no-restricted-syntax
updateHighlightedCode().catch(error => {
console.error('Error updating highlighted code:', error);
});
@ -513,6 +515,7 @@ def handle_webhook():
variant="outline"
size="sm"
onClick={() => {
// eslint-disable-next-line no-restricted-syntax
handleCopy(getCodeExample())
.catch(error => {
console.error('Failed to copy code example', error);

View File

@ -100,6 +100,7 @@ const Input = ({
<button
type="button"
onClick={() => {
// eslint-disable-next-line no-restricted-syntax
handleCopy().catch((error) => {
console.error('Failed to copy:', error);
});
@ -270,6 +271,7 @@ const AppleSecretGenerator = () => {
color="primary"
disabled={!(teamID.length === 10 && serviceID && file)}
onClick={() => {
// eslint-disable-next-line no-restricted-syntax
(async () => {
setError('');

View File

@ -167,6 +167,7 @@ export function AIChatDrawer() {
}
};
// eslint-disable-next-line no-restricted-syntax
fetchDocs().catch((error) => {
console.error('Failed to fetch documentation:', error);
});
@ -198,6 +199,7 @@ export function AIChatDrawer() {
},
onFinish: (message) => {
// Send AI response to Discord
// eslint-disable-next-line no-restricted-syntax
sendAIResponseToDiscord(message.content).catch(error => {
console.error('Failed to send AI response to Discord:', error);
});
@ -275,6 +277,7 @@ export function AIChatDrawer() {
}));
// Send message to Discord webhook
// eslint-disable-next-line no-restricted-syntax
sendToDiscord(input.trim()).catch(error => {
console.error('Discord webhook error:', error);
});
@ -285,6 +288,7 @@ export function AIChatDrawer() {
// Non-async wrapper for form onSubmit to avoid promise issues
const handleFormSubmit = (e: React.FormEvent) => {
// eslint-disable-next-line no-restricted-syntax
handleChatSubmit(e).catch(error => {
console.error('Chat submit error:', error);
});
@ -294,6 +298,7 @@ export function AIChatDrawer() {
const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
// eslint-disable-next-line no-restricted-syntax
handleChatSubmit(e as React.FormEvent).catch(error => {
console.error('Chat submit error:', error);
});

View File

@ -45,6 +45,7 @@ export function CompactCodeblock({ code, language = 'tsx', maxHeight = '200px',
}
};
// eslint-disable-next-line no-restricted-syntax
highlightCode().catch((error) => {
console.error('Error highlighting code:', error);
});
@ -55,6 +56,7 @@ export function CompactCodeblock({ code, language = 'tsx', maxHeight = '200px',
}, [code, language]);
const handleCopy = () => {
// eslint-disable-next-line no-restricted-syntax
void navigator.clipboard.writeText(code).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2000);

View File

@ -312,6 +312,7 @@ export function MessageFormatter({ content, className = '' }: MessageFormatterPr
}
};
// eslint-disable-next-line no-restricted-syntax
parseContent().catch((error) => {
console.error('Error parsing markdown:', error);
});

View File

@ -189,6 +189,7 @@ export function CustomSearchDialog({ open, onOpenChange }: CustomSearchDialogPro
}
searchTimeoutRef.current = setTimeout(() => {
// eslint-disable-next-line no-restricted-syntax
performSearch(query).catch((error) => {
console.error('Search failed:', error);
});

View File

@ -41,6 +41,7 @@ export function DynamicCodeblock({ code, language = 'tsx', title }: DynamicCodeb
}
};
// eslint-disable-next-line no-restricted-syntax
updateHighlightedCode().catch(error => {
console.error('Error updating highlighted code:', error);
});

View File

@ -44,6 +44,7 @@ export function Mermaid({ chart }: { chart: string }) {
}
}
// eslint-disable-next-line no-restricted-syntax
renderChart().catch(error => {
console.error('Failed to render Mermaid chart:', error);
});

View File

@ -193,6 +193,7 @@ function ClickableCodeblock({
}
};
// eslint-disable-next-line no-restricted-syntax
updateHighlightedCode().catch(error => {
console.error('Error updating highlighted code:', error);
});
@ -201,6 +202,7 @@ function ClickableCodeblock({
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
// eslint-disable-next-line no-restricted-syntax
updateHighlightedCode().catch(error => {
console.error('Error updating highlighted code on theme change:', error);
});

View File

@ -21,6 +21,7 @@ export default function Page() {
setPlayList(data);
}
// eslint-disable-next-line no-restricted-syntax
getPlayList().catch((error) => {
alert("An error occurred.");
console.error(error);

View File

@ -1,7 +1,7 @@
'use client';
import { useEffect, useState } from 'react';
import { useUser } from "@stackframe/stack";
import { useEffect, useState } from 'react';
export default function Page() {
const user = useUser({ or: 'redirect' });
@ -10,6 +10,7 @@ export default function Page() {
const [response, setResponse] = useState<any>();
useEffect(() => {
// eslint-disable-next-line no-restricted-syntax
fetch('https://www.googleapis.com/drive/v3/files', {
headers: { Authorization: `Bearer ${tokens.accessToken}` }
})

View File

@ -8,7 +8,7 @@
"pre-preinstall": "npx -y only-allow pnpm && node -e \"if(process.env.STACK_SKIP_TEMPLATE_GENERATION !== 'true') require('child_process').execSync('npx --package=tsx tsx ./scripts/generate-sdks.ts', {stdio: 'inherit'})\"",
"pre": "pnpm pre-preinstall",
"preinstall": "pnpm pre-preinstall",
"typecheck": "pnpm pre && turbo typecheck",
"typecheck": "pnpm pre && turbo typecheck --",
"build:dev": "pnpm pre && NODE_ENV=development pnpm run build",
"build": "pnpm pre && turbo build",
"build:backend": "pnpm pre && turbo run build --filter=@stackframe/stack-backend...",
@ -50,7 +50,7 @@
"start:backend": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/stack-backend",
"start:dashboard": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/stack-dashboard",
"start:mock-oauth-server": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/mock-oauth-server",
"lint": "pnpm pre && turbo run lint -- --max-warnings=0",
"lint": "pnpm pre && turbo run lint --continue -- --max-warnings=0",
"release": "pnpm pre && release",
"peek": "pnpm pre && pnpm release --peek",
"changeset": "pnpm pre && changeset",

View File

@ -307,40 +307,40 @@ For more information, please visit https://docs.stack-auth.com/getting-started/s
await ph_client.shutdown();
}
main()
.catch(async (err) => {
try {
await capture("error", {
error: err.message,
errorType: err instanceof UserError ? "UserError" : "SystemError",
stack: err.stack,
});
} catch (e) { }
if (!(err instanceof UserError)) {
console.error(err);
}
console.error('\n\n\n\n');
console.log(colorize.red`===============================================`);
console.error();
if (err instanceof UserError) {
console.error(`${colorize.red`ERROR!`} ${err.message}`);
} else {
console.error("An error occurred during the initialization process.");
}
console.error();
console.log(colorize.red`===============================================`);
console.error();
console.error(
"If you need assistance, please try installing Stack manually as described in https://docs.stack-auth.com/getting-started/setup or join our Discord where we're happy to help: https://discord.stack-auth.com"
);
if (!(err instanceof UserError)) {
console.error("");
console.error(`Error message: ${err.message}`);
}
console.error();
await ph_client.shutdown();
process.exit(1);
});
// eslint-disable-next-line no-restricted-syntax
main().catch(async (err) => {
try {
await capture("error", {
error: err.message,
errorType: err instanceof UserError ? "UserError" : "SystemError",
stack: err.stack,
});
} catch (e) { }
if (!(err instanceof UserError)) {
console.error(err);
}
console.error('\n\n\n\n');
console.log(colorize.red`===============================================`);
console.error();
if (err instanceof UserError) {
console.error(`${colorize.red`ERROR!`} ${err.message}`);
} else {
console.error("An error occurred during the initialization process.");
}
console.error();
console.log(colorize.red`===============================================`);
console.error();
console.error(
"If you need assistance, please try installing Stack manually as described in https://docs.stack-auth.com/getting-started/setup or join our Discord where we're happy to help: https://discord.stack-auth.com"
);
if (!(err instanceof UserError)) {
console.error("");
console.error(`Error message: ${err.message}`);
}
console.error();
await ph_client.shutdown();
process.exit(1);
});
type PackageJson = {

View File

@ -25,6 +25,7 @@ function OTP(props: {
useEffect(() => {
if (otp.length === 6 && !submitting) {
setSubmitting(true);
// eslint-disable-next-line no-restricted-syntax
stackApp.signInWithMagicLink(otp + props.nonce)
.then(result => {
if (result.status === 'error') {