mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-23 22:22:28 +08:00
chore: enable @typescript-eslint/no-floating-promises rule (#260)
This commit is contained in:
parent
586492a3f0
commit
b9dc323734
@ -33,6 +33,7 @@ const plugins = {
|
||||
};
|
||||
|
||||
export const baseRules = {
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
2,
|
||||
{ args: "none", caughtErrors: "none" },
|
||||
@ -184,6 +185,9 @@ const languageOptions = {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 9,
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
project: path.join(fileURLToPath(import.meta.url), "..", "tsconfig.all.json"),
|
||||
}
|
||||
};
|
||||
|
||||
export default [
|
||||
|
@ -74,7 +74,7 @@ function setupExitWatchdog(serverList: ServerList) {
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
async function startSSEServer(port: number, serverList: ServerList) {
|
||||
function startSSEServer(port: number, serverList: ServerList) {
|
||||
const sessions = new Map<string, SSEServerTransport>();
|
||||
const httpServer = http.createServer(async (req, res) => {
|
||||
if (req.method === 'POST') {
|
||||
|
@ -53,7 +53,7 @@ export const test = baseTest.extend<TestFixtures, WorkerFixtures>({
|
||||
const userDataDir = testInfo.outputPath('user-data-dir');
|
||||
let client: StdioClientTransport | undefined;
|
||||
|
||||
use(async options => {
|
||||
await use(async options => {
|
||||
const args = ['--user-data-dir', userDataDir];
|
||||
if (mcpHeadless)
|
||||
args.push('--headless');
|
||||
|
@ -42,8 +42,8 @@ test('browser_network_requests', async ({ client, server }) => {
|
||||
},
|
||||
});
|
||||
|
||||
expect.poll(() => client.callTool({
|
||||
await expect.poll(() => client.callTool({
|
||||
name: 'browser_network_requests',
|
||||
arguments: {},
|
||||
})).toHaveTextContent(`[GET] http://localhost:8907/json => [200] OK`);
|
||||
})).toHaveTextContent(`[GET] http://localhost:${server.PORT}/json => [200] OK`);
|
||||
});
|
||||
|
4
tsconfig.all.json
Normal file
4
tsconfig.all.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["**/*.ts", "**/*.js"],
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user