Skip to content

Commit b264685

Browse files
authored
lint: add tsconfig for browser_tests, fix existing violations (#5633)
## Summary See https://typescript-eslint.io/blog/project-service/ for context. Creates a browser_tests specific tsconfig so that they can be linted. Does not add a package.json script to do the linting yet, but `pnpm exec eslint browser_tests` should work for now. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5633-lint-add-tsconfig-for-browser_tests-fix-existing-violations-2726d73d3650819d8ef2c4b0abc31e14) by [Unito](https://www.unito.io)
1 parent 78d0ea6 commit b264685

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+109
-79
lines changed

browser_tests/fixtures/UserSelectPage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Page, test as base } from '@playwright/test'
1+
import type { Page } from '@playwright/test'
2+
import { test as base } from '@playwright/test'
23

34
export class UserSelectPage {
45
constructor(

browser_tests/fixtures/components/ComfyNodeSearchBox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Locator, Page } from '@playwright/test'
1+
import type { Locator, Page } from '@playwright/test'
22

33
export class ComfyNodeSearchFilterSelectionPanel {
44
constructor(public readonly page: Page) {}

browser_tests/fixtures/components/SettingDialog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Page } from '@playwright/test'
1+
import type { Page } from '@playwright/test'
22

3-
import { ComfyPage } from '../ComfyPage'
3+
import type { ComfyPage } from '../ComfyPage'
44

55
export class SettingDialog {
66
constructor(

browser_tests/fixtures/components/SidebarTab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Locator, Page } from '@playwright/test'
1+
import type { Locator, Page } from '@playwright/test'
22

33
class SidebarTab {
44
constructor(

browser_tests/fixtures/components/Topbar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Locator, Page, expect } from '@playwright/test'
1+
import type { Locator, Page } from '@playwright/test'
2+
import { expect } from '@playwright/test'
23

34
export class Topbar {
45
private readonly menuLocator: Locator

browser_tests/fixtures/ws.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ export const webSocketFixture = base.extend<{
1212
// so we can look it up to trigger messages
1313
const store: Record<string, WebSocket> = ((window as any).__ws__ = {})
1414
window.WebSocket = class extends window.WebSocket {
15-
constructor() {
16-
// @ts-expect-error
17-
super(...arguments)
15+
constructor(
16+
...rest: ConstructorParameters<typeof window.WebSocket>
17+
) {
18+
super(...rest)
1819
store[this.url] = this
1920
}
2021
}

browser_tests/globalSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FullConfig } from '@playwright/test'
1+
import type { FullConfig } from '@playwright/test'
22
import dotenv from 'dotenv'
33

44
import { backupPath } from './utils/backupUtils'

browser_tests/globalTeardown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FullConfig } from '@playwright/test'
1+
import type { FullConfig } from '@playwright/test'
22
import dotenv from 'dotenv'
33

44
import { restorePath } from './utils/backupUtils'

browser_tests/helpers/manageGroupNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Locator, Page } from '@playwright/test'
1+
import type { Locator, Page } from '@playwright/test'
22

33
export class ManageGroupNode {
44
footer: Locator

browser_tests/helpers/templates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Locator, Page } from '@playwright/test'
1+
import type { Locator, Page } from '@playwright/test'
22
import path from 'path'
33

4-
import {
4+
import type {
55
TemplateInfo,
66
WorkflowTemplates
77
} from '../../src/platform/workflow/templates/types/template'

0 commit comments

Comments
 (0)