From 069b0949d554d7673a05b27b7ee8bf9ffb9c0688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 11 Apr 2023 11:55:06 +0200 Subject: [PATCH] Enable the @typescript-eslint/no-floating-promises rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rūdolfs Ošiņš --- .eslintrc.json | 4 +++- tests/e2e/project.spec.ts | 2 +- tests/support/globalSetup.ts | 2 +- tsconfig.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2ca14e032..4a82e11ec 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,8 @@ "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2020, - "sourceType": "module" + "sourceType": "module", + "project": ["./tsconfig.json"] }, "plugins": ["svelte3", "@typescript-eslint"], "overrides": [ @@ -49,6 +50,7 @@ ], "eol-last": ["error"], "key-spacing": ["error"], + "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/object-curly-spacing": ["error", "always"], "@typescript-eslint/type-annotation-spacing": ["error"], "@typescript-eslint/naming-convention": [ diff --git a/tests/e2e/project.spec.ts b/tests/e2e/project.spec.ts index c81d547d3..62bed9e52 100644 --- a/tests/e2e/project.spec.ts +++ b/tests/e2e/project.spec.ts @@ -72,7 +72,7 @@ test("show source tree at specific revision", async ({ page }) => { await expect(page.getByTitle("Current branch")).toContainText( "335dd6dc89b535a4a31e9422c803199bb6b0a09a", ); - expect(page.locator(".source-tree")).toHaveText("bin/ src/"); + await expect(page.locator(".source-tree")).toHaveText("bin/ src/"); await expectCounts({ commits: 2, contributors: 1 }, page); }); diff --git a/tests/support/globalSetup.ts b/tests/support/globalSetup.ts index e98a11485..de9dd8a91 100644 --- a/tests/support/globalSetup.ts +++ b/tests/support/globalSetup.ts @@ -3,7 +3,7 @@ import type { FullConfig } from "@playwright/test"; import { seedPort, seedRemote } from "@tests/support/fixtures.js"; export default async function globalSetup(_config: FullConfig): Promise { - assertHttpApiRunning(); + await assertHttpApiRunning(); } // Assert that the test http-api is running. If it is not running, throw an diff --git a/tsconfig.json b/tsconfig.json index 998fcbbe9..c8ef59cb5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@tsconfig/svelte/tsconfig.json", - "include": ["src", "tests", "httpd-client"], + "include": ["src", "tests", "httpd-client", "./*.js", "./*.ts"], "exclude": ["node_modules/*"], "compilerOptions": { "target": "es2020",