Skip to content

[Lint] Sort imports #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -20,4 +20,4 @@ jobs:
run: npm ci

- name: Run Prettier check
run: npx prettier --check './**/*.{js,ts,tsx,vue}'
run: npm run format:check
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -3,5 +3,8 @@
"tabWidth": 2,
"semi": false,
"trailingComma": "none",
"printWidth": 80
"printWidth": 80,
"importOrder": ["^@core/(.*)$", "<THIRD_PARTY_MODULES>", "^@/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
3 changes: 2 additions & 1 deletion browser_tests/actionbar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Response } from '@playwright/test'
import type { StatusWsMessage } from '../src/types/apiTypes.ts'
import { expect, mergeTests } from '@playwright/test'

import type { StatusWsMessage } from '../src/types/apiTypes.ts'
import { comfyPageFixture } from './fixtures/ComfyPage'
import { webSocketFixture } from './fixtures/ws.ts'

1 change: 1 addition & 0 deletions browser_tests/browserTabTitle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Browser tab title', () => {
4 changes: 2 additions & 2 deletions browser_tests/changeTracker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ComfyPage,
comfyPageFixture as test,
comfyExpect as expect
comfyExpect as expect,
comfyPageFixture as test
} from './fixtures/ComfyPage'

async function beforeChange(comfyPage: ComfyPage) {
1 change: 1 addition & 0 deletions browser_tests/colorPalette.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

const customColorPalettes = {
1 change: 1 addition & 0 deletions browser_tests/commands.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Keybindings', () => {
1 change: 1 addition & 0 deletions browser_tests/copyPaste.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Copy Paste', () => {
1 change: 1 addition & 0 deletions browser_tests/dialog.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Load workflow warning', () => {
1 change: 1 addition & 0 deletions browser_tests/extensionAPI.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Topbar commands', () => {
16 changes: 9 additions & 7 deletions browser_tests/fixtures/ComfyPage.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import type { Page, Locator, APIRequestContext } from '@playwright/test'
import type { APIRequestContext, Locator, Page } from '@playwright/test'
import { expect } from '@playwright/test'
import { test as base } from '@playwright/test'
import { ComfyActionbar } from '../helpers/actionbar'
import dotenv from 'dotenv'
dotenv.config()
import * as fs from 'fs'
import { NodeBadgeMode } from '../../src/types/nodeSource'

import type { useWorkspaceStore } from '../../src/stores/workspaceStore'
import type { NodeId } from '../../src/types/comfyWorkflow'
import type { KeyCombo } from '../../src/types/keyBindingTypes'
import { NodeBadgeMode } from '../../src/types/nodeSource'
import { ComfyActionbar } from '../helpers/actionbar'
import { ComfyTemplates } from '../helpers/templates'
import { ComfyNodeSearchBox } from './components/ComfyNodeSearchBox'
import { SettingDialog } from './components/SettingDialog'
import {
NodeLibrarySidebarTab,
WorkflowsSidebarTab
} from './components/SidebarTab'
import { Topbar } from './components/Topbar'
import { NodeReference } from './utils/litegraphUtils'
import type { Position, Size } from './types'
import type { useWorkspaceStore } from '../../src/stores/workspaceStore'
import { SettingDialog } from './components/SettingDialog'
import { NodeReference } from './utils/litegraphUtils'

dotenv.config()

type WorkspaceStore = ReturnType<typeof useWorkspaceStore>

2 changes: 1 addition & 1 deletion browser_tests/fixtures/UserSelectPage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Page } from 'playwright'
import { test as base } from '@playwright/test'
import { Page } from 'playwright'

export class UserSelectPage {
constructor(
5 changes: 3 additions & 2 deletions browser_tests/fixtures/utils/litegraphUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ManageGroupNode } from '../../helpers/manageGroupNode'
import type { NodeId } from '../../../src/types/comfyWorkflow'
import type { Page } from '@playwright/test'

import type { NodeId } from '../../../src/types/comfyWorkflow'
import { ManageGroupNode } from '../../helpers/manageGroupNode'
import type { ComfyPage } from '../ComfyPage'
import type { Position, Size } from '../types'

3 changes: 2 additions & 1 deletion browser_tests/globalSetup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { FullConfig } from '@playwright/test'
import { backupPath } from './utils/backupUtils'
import dotenv from 'dotenv'

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

dotenv.config()

export default function globalSetup(config: FullConfig) {
3 changes: 2 additions & 1 deletion browser_tests/globalTeardown.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { FullConfig } from '@playwright/test'
import { restorePath } from './utils/backupUtils'
import dotenv from 'dotenv'

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

dotenv.config()

export default function globalTeardown(config: FullConfig) {
1 change: 1 addition & 0 deletions browser_tests/graphCanvasMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Graph Canvas Menu', () => {
1 change: 1 addition & 0 deletions browser_tests/groupNode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { ComfyPage, comfyPageFixture as test } from './fixtures/ComfyPage'
import type { NodeReference } from './fixtures/utils/litegraphUtils'

3 changes: 2 additions & 1 deletion browser_tests/helpers/actionbar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Page, Locator } from '@playwright/test'
import type { Locator, Page } from '@playwright/test'

import type { AutoQueueMode } from '../../src/stores/queueStore'

export class ComfyActionbar {
1 change: 1 addition & 0 deletions browser_tests/helpers/manageGroupNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Locator, Page } from '@playwright/test'

export class ManageGroupNode {
footer: Locator
header: Locator
1 change: 1 addition & 0 deletions browser_tests/helpers/templates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Locator, Page } from '@playwright/test'

export class ComfyTemplates {
readonly content: Locator

1 change: 1 addition & 0 deletions browser_tests/interaction.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Item Interaction', () => {
1 change: 1 addition & 0 deletions browser_tests/keybindings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Keybindings', () => {
1 change: 1 addition & 0 deletions browser_tests/litegraphEvent.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

function listenForEvent(): Promise<Event> {
1 change: 1 addition & 0 deletions browser_tests/loadWorkflowInMedia.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Load Workflow in Media', () => {
1 change: 1 addition & 0 deletions browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Menu', () => {
3 changes: 2 additions & 1 deletion browser_tests/nodeBadge.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './fixtures/ComfyPage'

import type { ComfyApp } from '../src/scripts/app'
import { NodeBadgeMode } from '../src/types/nodeSource'
import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Node Badge', () => {
test('Can add badge', async ({ comfyPage }) => {
1 change: 1 addition & 0 deletions browser_tests/nodeDisplay.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

// If an input is optional by node definition, it should be shown as
4 changes: 2 additions & 2 deletions browser_tests/nodeSearchBox.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
comfyPageFixture as test,
comfyExpect as expect
comfyExpect as expect,
comfyPageFixture as test
} from './fixtures/ComfyPage'

test.describe('Node search box', () => {
1 change: 1 addition & 0 deletions browser_tests/primitiveNode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'
import type { NodeReference } from './fixtures/utils/litegraphUtils'

1 change: 1 addition & 0 deletions browser_tests/propertiesPanel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Properties Panel', () => {
1 change: 1 addition & 0 deletions browser_tests/rerouteNode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Reroute Node', () => {
3 changes: 2 additions & 1 deletion browser_tests/rightClickMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './fixtures/ComfyPage'

import { NodeBadgeMode } from '../src/types/nodeSource'
import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Canvas Right Click Menu', () => {
// See https://github.com/comfyanonymous/ComfyUI/issues/3883
1 change: 1 addition & 0 deletions browser_tests/templates.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Templates', () => {
1 change: 1 addition & 0 deletions browser_tests/textWidgetTruncate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { comfyPageFixture as test } from './fixtures/ComfyPage'

test.describe('Combo text widget', () => {
1 change: 1 addition & 0 deletions browser_tests/userSelectView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@playwright/test'

import { userSelectPageFixture as test } from './fixtures/UserSelectPage'

/**
2 changes: 1 addition & 1 deletion browser_tests/utils/backupUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import fs from 'fs-extra'
import path from 'path'

type PathParts = readonly [string, ...string[]]

6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import unusedImports from 'eslint-plugin-unused-imports'
import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default [
{
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export default {

function formatAndEslint(fileNames) {
return [
`prettier --write ${fileNames.join(' ')}`,
`prettier --write ${fileNames.join(' ')} --plugin @trivago/prettier-plugin-sort-imports`,
`eslint --fix ${fileNames.join(' ')}`
]
}
Loading
Loading