From 8a353bc1e39f756d94b19e450f14d372e343c538 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:25:50 +1100 Subject: [PATCH] feat(ui): configure knip --- invokeai/frontend/web/knip.ts | 14 ++++++++++++++ invokeai/frontend/web/package.json | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/knip.ts b/invokeai/frontend/web/knip.ts index 479dd27a96..a96b96f1f7 100644 --- a/invokeai/frontend/web/knip.ts +++ b/invokeai/frontend/web/knip.ts @@ -6,6 +6,20 @@ const config: KnipConfig = { 'src/app/store/middleware/debugLoggerMiddleware.ts', ], ignoreBinaries: ['only-allow'], + rules: { + files: 'warn', + dependencies: 'warn', + unlisted: 'warn', + binaries: 'warn', + unresolved: 'warn', + exports: 'warn', + types: 'warn', + nsExports: 'warn', + nsTypes: 'warn', + enumMembers: 'warn', + classMembers: 'warn', + duplicates: 'warn', + }, }; export default config; diff --git a/invokeai/frontend/web/package.json b/invokeai/frontend/web/package.json index 8e8faa5c84..abc9ac059b 100644 --- a/invokeai/frontend/web/package.json +++ b/invokeai/frontend/web/package.json @@ -24,16 +24,16 @@ "build": "pnpm run lint && vite build", "typegen": "node scripts/typegen.js", "preview": "vite preview", + "lint:knip": "knip", "lint:madge": "madge --circular src/main.tsx", "lint:eslint": "eslint --max-warnings=0 .", "lint:prettier": "prettier --check .", "lint:tsc": "tsc --noEmit", - "lint": "concurrently -g -n eslint,prettier,tsc,madge -c cyan,green,magenta,yellow \"pnpm run lint:eslint\" \"pnpm run lint:prettier\" \"pnpm run lint:tsc\" \"pnpm run lint:madge\"", - "fix": "eslint --fix . && prettier --log-level warn --write .", + "lint": "concurrently -g -c red,green,yellow,blue,magenta pnpm:lint:*", + "fix": "knip --fix && eslint --fix . && prettier --log-level warn --write .", "preinstall": "npx only-allow pnpm", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "knip": "knip", "test": "vitest", "test:no-watch": "vitest --no-watch" },