Skip to content

Commit d424a78

Browse files
refactor(DT-3906): Add knip (#3350)
* Install knip * Fix unresolved imports * Add knip and remove unused deps
1 parent 08bd2f0 commit d424a78

6 files changed

Lines changed: 665 additions & 1610 deletions

File tree

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"esbenp.prettier-vscode",
55
"bradlc.vscode-tailwindcss",
66
"svelte.svelte-vscode",
7-
"yoavbls.pretty-ts-errors"
7+
"yoavbls.pretty-ts-errors",
8+
"webpro.vscode-knip"
89
]
910
}

knip.config.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { KnipConfig } from 'knip';
2+
3+
const config: KnipConfig = {
4+
entry: [
5+
'.github/scripts/**/*',
6+
'./plugins/**/*',
7+
'./scripts/**/*',
8+
'./tests/**/*',
9+
'./utilities/**/*',
10+
'./temporal/**/*',
11+
],
12+
project: ['**/*.{svelte,css,js,cjs,mjs,ts}'],
13+
ignore: [
14+
// Is actually used via path.resolve in ./src/routes/(app)/render/+server.ts
15+
'./src/markdown.reset.css',
16+
],
17+
// from ./utilities/temporal-server.ts and ./utilities/ui-server.ts
18+
ignoreBinaries: ['which', 'server', 'go', 'air', 'make', 'start'],
19+
ignoreDependencies: [
20+
// unclear if needed by @codemirror/language
21+
'@codemirror/language-data',
22+
],
23+
};
24+
25+
export default config;

package.json

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"run-workflows": "esno scripts/run-workflows.ts",
7777
"audit:tailwind": "esno scripts/audit-tailwind-colors",
7878
"audit:holocene-props": "esno scripts/generate-holocene-props.ts",
79-
"validate:versions": "./scripts/validate-versions.sh"
79+
"validate:versions": "./scripts/validate-versions.sh",
80+
"knip": "knip"
8081
},
8182
"dependencies": {
8283
"@codemirror/autocomplete": "^6.18.7",
@@ -97,8 +98,8 @@
9798
"@sveltejs/package": "^2.3.10",
9899
"class-variance-authority": "^0.7.0",
99100
"danger": "^13.0.5",
100-
"date-fns": "^2.29.3",
101-
"date-fns-tz": "^1.3.7",
101+
"date-fns": "2.29.x",
102+
"date-fns-tz": "1.3.x",
102103
"esm-env": "^1.0.0",
103104
"hast-util-sanitize": "^5.0.1",
104105
"hast-util-to-html": "^9.0.1",
@@ -109,7 +110,6 @@
109110
"just-debounce": "^1.1.0",
110111
"just-throttle": "^4.2.0",
111112
"kebab-case": "^1.0.2",
112-
"lodash.groupby": "^4.6.0",
113113
"mdast-util-from-markdown": "^2.0.1",
114114
"mdast-util-to-hast": "^13.2.0",
115115
"remark-stringify": "^10.0.3",
@@ -122,21 +122,16 @@
122122
"devDependencies": {
123123
"@axe-core/playwright": "^4.10.1",
124124
"@babel/core": "^7.20.12",
125-
"@babel/preset-typescript": "^7.18.6",
126125
"@chromatic-com/storybook": "^3.2.6",
127126
"@eslint/js": "^9.39.2",
128-
"@grpc/grpc-js": "^1.8.22",
129127
"@playwright/test": "^1.55.1",
130128
"@storybook/addon-a11y": "^8.6.18",
131129
"@storybook/addon-actions": "^8.6.18",
132-
"@storybook/addon-docs": "^8.6.18",
133130
"@storybook/addon-essentials": "^8.6.18",
134131
"@storybook/addon-interactions": "^8.6.18",
135132
"@storybook/addon-links": "^8.6.18",
136133
"@storybook/addon-svelte-csf": "^5.0.10",
137134
"@storybook/addon-themes": "^8.6.18",
138-
"@storybook/blocks": "^8.6.18",
139-
"@storybook/icons": "^1.4.0",
140135
"@storybook/svelte": "^8.6.18",
141136
"@storybook/sveltekit": "^8.6.18",
142137
"@storybook/test": "^8.6.18",
@@ -149,31 +144,22 @@
149144
"@temporalio/client": "1.16.0",
150145
"@temporalio/common": "1.16.0",
151146
"@temporalio/proto": "1.16.0",
152-
"@temporalio/testing": "1.16.0",
153147
"@temporalio/worker": "1.16.0",
154148
"@temporalio/workflow": "1.16.0",
155-
"@types/base-64": "^1.0.0",
156149
"@types/cors": "^2.8.13",
157150
"@types/express": "^4.17.17",
158151
"@types/json-bigint": "^1.0.1",
159-
"@types/mkdirp": "^1.0.2",
160152
"@types/node": "^18.15.3",
161-
"@types/sanitize-html": "^2.8.0",
162153
"@types/tar-fs": "^2.0.4",
163-
"@types/unist": "^3.0.0",
164154
"@types/yargs": "^17.0.24",
165-
"@typescript-eslint/eslint-plugin": "^8.54.0",
166-
"@typescript-eslint/parser": "^8.54.0",
155+
"@vitest/coverage-v8": "^4.1.5",
167156
"@vitest/ui": "^3.1.1",
168157
"autoprefixer": "^10.4.13",
158+
"axe-core": "^4.10.0",
169159
"axe-playwright": "^2.0.3",
170-
"c8": "^7.12.0",
171-
"chalk": "^4.1.2",
172160
"cors": "^2.8.5",
173161
"cssnano": "^5.1.14",
174162
"desm": "^1.3.1",
175-
"ejs": "^3.1.10",
176-
"esbuild": "^0.25.0",
177163
"eslint": "^9.39.2",
178164
"eslint-config-prettier": "^10.1.8",
179165
"eslint-plugin-import-x": "^4.16.1",
@@ -185,31 +171,23 @@
185171
"express": "^4.18.2",
186172
"fast-glob": "^3.3.1",
187173
"globals": "^17.2.0",
188-
"google-protobuf": "^3.21.2",
189174
"helmet": "^8.1.0",
190175
"husky": "^8.0.3",
191176
"jsdom": "^20.0.3",
177+
"knip": "^6.7.0",
192178
"lint-staged": "^16.2.7",
193179
"lodash": "^4.18.1",
194180
"mkdirp": "^2.1.3",
195-
"mock-socket": "^9.1.5",
196181
"nanoid": "^5.1.5",
197182
"node-fetch": "^3.3.0",
198-
"npm-run-all": "^4.1.5",
199183
"oidc-provider": "^9.0.1",
200184
"postcss": "^8.4.31",
201-
"postcss-cli": "^9.1.0",
202185
"postcss-html": "^1.5.0",
203-
"postcss-import": "^14.1.0",
204186
"postcss-load-config": "^3.1.4",
205187
"prettier": "3.8.1",
206188
"prettier-plugin-svelte": "^3.3.3",
207189
"prettier-plugin-tailwindcss": "^0.7.2",
208190
"react": "^18.2.0",
209-
"react-dom": "^18.2.0",
210-
"rehype-document": "^6.1.0",
211-
"rehype-format": "^4.0.1",
212-
"rehype-stringify": "^9.0.4",
213191
"remark": "^14.0.3",
214192
"remark-gfm": "^3.0.1",
215193
"remark-parse": "^10.0.2",
@@ -221,22 +199,17 @@
221199
"stylelint-config-standard": "^40.0.0",
222200
"svelte": "5.55.1",
223201
"svelte-check": "^4.1.5",
224-
"svelte-eslint-parser": "^1.4.1",
225-
"svelte-highlight": "^7.8.2",
226-
"svelte-loader": "^3.2.4",
227202
"svelte-preprocess": "^6.0.3",
228203
"svelte2tsx": "^0.7.35",
229204
"tailwindcss": "^3.4.1",
230205
"tar-fs": "^3.1.2",
231-
"tslib": "^2.4.1",
232206
"typescript": "^5.2.2",
233207
"typescript-eslint": "^8.54.0",
234208
"unist-util-visit": "^5.0.0",
235209
"vite": "^6.4.2",
236210
"vitest": "^3.1.1",
237211
"vitest-localstorage-mock": "^0.1.2",
238212
"wait-port": "^1.0.4",
239-
"webpack": "^5.105.2",
240213
"yargs": "^17.7.2",
241214
"zx": "^8.8.5"
242215
},

0 commit comments

Comments
 (0)