chore: enable @typescript-eslint/no-floating-promises rule (#260)

This commit is contained in:
Max Schmitt 2025-04-23 16:03:30 +02:00 committed by GitHub
parent 586492a3f0
commit b9dc323734
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 4 deletions

View File

@ -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 [

View File

@ -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') {

View File

@ -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');

View File

@ -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
View File

@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["**/*.ts", "**/*.js"],
}