mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-25 16:02:26 +08:00
lint: ban console output (#317)
This commit is contained in:
parent
685dea9e19
commit
23ce973377
@ -180,6 +180,7 @@ export const baseRules = {
|
||||
|
||||
// react
|
||||
"react/react-in-jsx-scope": 0,
|
||||
"no-console": 2,
|
||||
};
|
||||
|
||||
const languageOptions = {
|
||||
|
@ -41,7 +41,6 @@ program
|
||||
.option('--config <path>', 'Path to the configuration file.')
|
||||
.action(async options => {
|
||||
const config = await resolveConfig(options);
|
||||
console.error(config);
|
||||
const serverList = new ServerList(() => createServer(config));
|
||||
setupExitWatchdog(serverList);
|
||||
|
||||
|
@ -49,7 +49,10 @@ async function handleSSE(req: http.IncomingMessage, res: http.ServerResponse, ur
|
||||
const server = await serverList.create();
|
||||
res.on('close', () => {
|
||||
sessions.delete(transport.sessionId);
|
||||
serverList.close(server).catch(e => console.error(e));
|
||||
serverList.close(server).catch(e => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(e);
|
||||
});
|
||||
});
|
||||
return await server.connect(transport);
|
||||
}
|
||||
@ -113,15 +116,19 @@ export function startHttpTransport(port: number, hostname: string | undefined, s
|
||||
resolvedHost = 'localhost';
|
||||
url = `http://${resolvedHost}:${resolvedPort}`;
|
||||
}
|
||||
console.log(`Listening on ${url}`);
|
||||
console.log('Put this in your client config:');
|
||||
console.log(JSON.stringify({
|
||||
'mcpServers': {
|
||||
'playwright': {
|
||||
'url': `${url}/sse`
|
||||
const message = [
|
||||
`Listening on ${url}`,
|
||||
'Put this in your client config:',
|
||||
JSON.stringify({
|
||||
'mcpServers': {
|
||||
'playwright': {
|
||||
'url': `${url}/sse`
|
||||
}
|
||||
}
|
||||
}
|
||||
}, undefined, 2));
|
||||
console.log('If your client supports streamable HTTP, you can use the /mcp endpoint instead.');
|
||||
}, undefined, 2),
|
||||
'If your client supports streamable HTTP, you can use the /mcp endpoint instead.',
|
||||
].join('\n');
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(message);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user