Skip to content

Commit a82fcd8

Browse files
DrJKLactions-usergithub-actions
authored
Knip: Enable more rules (#5309)
* knip: Simplify config * knip: enable unlisted, fix issues * knip: Add ignore for build dependencies (Vite plugin indirect reference) * knip: Prune dependencies * knip: One more Unused dep * git: Standard line end for yaml * [auto-fix] Apply ESLint and Prettier fixes * knip: Add exceptions for tailwindcss post-rebase. Not sure why we need to except it. * Update test expectations [skip ci] --------- Co-authored-by: GitHub Action <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 9a9f8c7 commit a82fcd8

10 files changed

+167
-336
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*.mts text eol=lf
1010
*.ts text eol=lf
1111
*.vue text eol=lf
12+
*.yaml text eol=lf
1213

1314
# Generated files
1415
src/types/comfyRegistryTypes.ts linguist-generated=true

browser_tests/fixtures/UserSelectPage.ts

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

43
export class UserSelectPage {
54
constructor(

browser_tests/fixtures/utils/taskHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import type { Request, Route } from '@playwright/test'
12
import _ from 'es-toolkit/compat'
23
import fs from 'fs'
34
import path from 'path'
4-
import type { Request, Route } from 'playwright'
55
import { v4 as uuidv4 } from 'uuid'
66

77
import type {
58 Bytes
Loading
58 Bytes
Loading
63 Bytes
Loading
63 Bytes
Loading

knip.config.ts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,31 @@ import type { KnipConfig } from 'knip'
22

33
const config: KnipConfig = {
44
entry: [
5+
'build/**/*.ts',
6+
'scripts/**/*.{js,ts}',
57
'src/main.ts',
6-
'vite.config.mts',
78
'vite.electron.config.mts',
8-
'vite.types.config.mts',
9-
'eslint.config.js',
10-
'tailwind.config.ts',
11-
'postcss.config.js',
12-
'playwright.config.ts',
13-
'playwright.i18n.config.ts',
14-
'vitest.config.ts',
15-
'vitest.litegraph.config.ts',
16-
'scripts/**/*.{js,ts}'
9+
'vite.types.config.mts'
1710
],
1811
project: [
12+
'browser_tests/**/*.{js,ts}',
13+
'build/**/*.{js,ts,vue}',
14+
'scripts/**/*.{js,ts}',
1915
'src/**/*.{js,ts,vue}',
2016
'tests-ui/**/*.{js,ts,vue}',
21-
'browser_tests/**/*.{js,ts}',
22-
'scripts/**/*.{js,ts}'
17+
'*.{js,ts,mts}'
18+
],
19+
ignoreDependencies: [
20+
'@primeuix/forms',
21+
'@primeuix/styled',
22+
'@primeuix/utils',
23+
'@primevue/icons',
24+
'@iconify/json',
25+
'tailwindcss',
26+
'tailwindcss-primeui', // Need to figure out why tailwind plugin isn't applying
27+
// Dev
28+
'@executeautomation/playwright-mcp-server',
29+
'@trivago/prettier-plugin-sort-imports'
2330
],
2431
ignore: [
2532
// Generated files
@@ -57,29 +64,21 @@ const config: KnipConfig = {
5764
ignoreExportsUsedInFile: true,
5865
// Vue-specific configuration
5966
vue: true,
67+
tailwind: true,
6068
// Only check for unused files, disable all other rules
6169
// TODO: Gradually enable other rules - see https://github.com/Comfy-Org/ComfyUI_frontend/issues/4888
6270
rules: {
6371
binaries: 'off',
6472
classMembers: 'off',
65-
dependencies: 'off',
66-
devDependencies: 'off',
6773
duplicates: 'off',
6874
enumMembers: 'off',
6975
exports: 'off',
7076
nsExports: 'off',
7177
nsTypes: 'off',
72-
types: 'off',
73-
unlisted: 'off'
78+
types: 'off'
7479
},
7580
// Include dependencies analysis
76-
includeEntryExports: true,
77-
// Workspace configuration for monorepo-like structure
78-
workspaces: {
79-
'.': {
80-
entry: ['src/main.ts', 'playwright.i18n.config.ts']
81-
}
82-
}
81+
includeEntryExports: true
8382
}
8483

8584
export default config

package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,29 @@
4040
"devDependencies": {
4141
"@eslint/js": "^9.8.0",
4242
"@executeautomation/playwright-mcp-server": "^1.0.6",
43-
"@iconify/json": "^2.2.245",
4443
"@iconify/tailwind": "^1.2.0",
4544
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
4645
"@lobehub/i18n-cli": "^1.25.1",
4746
"@nx/eslint": "21.4.1",
4847
"@nx/playwright": "21.4.1",
4948
"@nx/storybook": "21.4.1",
5049
"@nx/vite": "21.4.1",
51-
"@nx/web": "21.4.1",
5250
"@pinia/testing": "^0.1.5",
5351
"@playwright/test": "^1.52.0",
5452
"@storybook/addon-docs": "^9.1.1",
5553
"@storybook/vue3": "^9.1.1",
5654
"@storybook/vue3-vite": "^9.1.1",
5755
"@tailwindcss/vite": "^4.1.12",
5856
"@trivago/prettier-plugin-sort-imports": "^5.2.0",
59-
"@types/dompurify": "^3.0.5",
6057
"@types/fs-extra": "^11.0.4",
6158
"@types/jsdom": "^21.1.7",
6259
"@types/node": "^20.14.8",
6360
"@types/semver": "^7.7.0",
6461
"@types/three": "^0.169.0",
6562
"@vitejs/plugin-vue": "^5.1.4",
63+
"@vitest/coverage-v8": "^3.2.4",
6664
"@vitest/ui": "^3.0.0",
6765
"@vue/test-utils": "^2.4.6",
68-
"chalk": "^5.3.0",
69-
"commander": "^14.0.0",
7066
"eslint": "^9.12.0",
7167
"eslint-config-prettier": "^10.1.2",
7268
"eslint-plugin-prettier": "^5.2.6",
@@ -77,18 +73,13 @@
7773
"globals": "^15.9.0",
7874
"happy-dom": "^15.11.0",
7975
"husky": "^9.0.11",
80-
"identity-obj-proxy": "^3.0.0",
81-
"ink": "^6.2.2",
8276
"jiti": "2.4.2",
8377
"jsdom": "^26.1.0",
8478
"knip": "^5.62.0",
8579
"lint-staged": "^15.2.7",
8680
"lucide-vue-next": "^0.540.0",
8781
"nx": "21.4.1",
88-
"postcss": "^8.4.39",
8982
"prettier": "^3.3.2",
90-
"react": "^19.1.1",
91-
"react-reconciler": "^0.32.0",
9283
"storybook": "^9.1.1",
9384
"tailwindcss": "^4.1.12",
9485
"tailwindcss-primeui": "^0.6.1",
@@ -111,14 +102,14 @@
111102
"@alloc/quick-lru": "^5.2.0",
112103
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
113104
"@comfyorg/comfyui-electron-types": "^0.4.69",
105+
"@iconify/json": "^2.2.380",
114106
"@primeuix/forms": "0.0.2",
115107
"@primeuix/styled": "0.3.2",
116108
"@primeuix/utils": "^0.3.2",
117109
"@primevue/core": "^4.2.5",
118110
"@primevue/forms": "^4.2.5",
119111
"@primevue/icons": "4.2.5",
120112
"@primevue/themes": "^4.2.5",
121-
"@sentry/core": "^10.5.0",
122113
"@sentry/vue": "^8.48.0",
123114
"@tiptap/core": "^2.10.4",
124115
"@tiptap/extension-link": "^2.10.4",

0 commit comments

Comments
 (0)