Skip to content

Commit 8686b9a

Browse files
chore: 🤖 enable knip and remove dead code and export (#2099)
* chore: 🤖 enable knip and remove dead code and export * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent bf04fe5 commit 8686b9a

File tree

68 files changed

+368
-1634
lines changed

Some content is hidden

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

68 files changed

+368
-1634
lines changed

docs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "@milkdown/docs",
33
"private": true,
44
"version": "1.0.0",
5-
"description": "",
6-
"main": "index.js",
5+
"description": "Auto generated docs for Milkdown",
76
"scripts": {
87
"build": "tsx -C import ./src/index.ts"
98
},

e2e/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,21 @@
1212
"test:install": "playwright install --with-deps"
1313
},
1414
"dependencies": {
15-
"@codemirror/commands": "^6.3.3",
16-
"@codemirror/language-data": "^6.4.1",
17-
"@codemirror/state": "^6.4.1",
18-
"@codemirror/theme-one-dark": "^6.1.2",
19-
"@codemirror/view": "^6.26.0",
2015
"@milkdown/core": "workspace:*",
2116
"@milkdown/crepe": "workspace:*",
2217
"@milkdown/ctx": "workspace:*",
2318
"@milkdown/plugin-automd": "workspace:*",
2419
"@milkdown/plugin-clipboard": "workspace:*",
25-
"@milkdown/plugin-cursor": "workspace:*",
26-
"@milkdown/plugin-emoji": "workspace:*",
2720
"@milkdown/plugin-history": "workspace:*",
2821
"@milkdown/plugin-listener": "workspace:*",
29-
"@milkdown/plugin-tooltip": "workspace:*",
3022
"@milkdown/preset-commonmark": "workspace:*",
3123
"@milkdown/preset-gfm": "workspace:*",
3224
"@milkdown/prose": "workspace:*",
3325
"@milkdown/theme-nord": "workspace:*",
3426
"@milkdown/utils": "workspace:*",
3527
"@playwright/test": "^1.54.1",
3628
"@types/node": "^22.0.0",
37-
"katex": "^0.16.0",
3829
"serve": "^14.2.3",
39-
"tslib": "^2.8.1",
4030
"vue": "^3.5.20"
4131
}
4232
}

e2e/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424
{ "path": "../packages/ctx" },
2525
{ "path": "../packages/plugins/plugin-automd" },
2626
{ "path": "../packages/plugins/plugin-clipboard" },
27-
{ "path": "../packages/plugins/plugin-cursor" },
28-
{ "path": "../packages/plugins/plugin-emoji" },
2927
{ "path": "../packages/plugins/plugin-history" },
3028
{ "path": "../packages/plugins/plugin-listener" },
31-
{ "path": "../packages/plugins/plugin-tooltip" },
3229
{ "path": "../packages/plugins/preset-commonmark" },
3330
{ "path": "../packages/plugins/preset-gfm" },
3431
{ "path": "../packages/prose" },

knip.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
3+
"workspaces": {
4+
"e2e": {
5+
"entry": ["src/**/main.ts"]
6+
},
7+
"packages/plugins/theme-nord": {
8+
"ignoreDependencies": ["@milkdown/prose"]
9+
}
10+
}
11+
}

package.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"release": "changeset publish",
3030
"commit": "git-cz",
3131
"prepare": "husky",
32-
"storybook": "pnpm --filter=@milkdown/e2e run storybook"
32+
"storybook": "pnpm --filter=@milkdown/e2e run storybook",
33+
"knip": "knip"
3334
},
3435
"devDependencies": {
3536
"@changesets/cli": "^2.22.0",
@@ -39,46 +40,38 @@
3940
"@rollup/plugin-commonjs": "^28.0.0",
4041
"@rollup/plugin-json": "^6.0.0",
4142
"@rollup/plugin-node-resolve": "^16.0.0",
42-
"@rollup/plugin-typescript": "^12.0.0",
4343
"@tailwindcss/postcss": "^4.0.0",
4444
"@tailwindcss/vite": "^4.0.0",
4545
"@testing-library/dom": "^10.4.0",
4646
"@testing-library/jest-dom": "^6.6.3",
4747
"@testing-library/user-event": "^14.6.1",
48-
"@types/node": "^22.0.0",
49-
"@types/rollup-plugin-auto-external": "^2.0.2",
48+
"@types/node": "^22.18.1",
5049
"@typescript-eslint/parser": "^8.29.1",
51-
"@vitejs/plugin-react": "^5.0.0",
5250
"@vitejs/plugin-vue-jsx": "^5.0.0",
5351
"autoprefixer": "^10.2.5",
54-
"concurrently": "^9.0.0",
55-
"cross-env": "^10.0.0",
5652
"esbuild": "^0.25.0",
5753
"eslint": "^9.24.0",
5854
"eslint-plugin-perfectionist": "^4.11.0",
5955
"git-cz": "^4.7.6",
6056
"husky": "^9.0.10",
6157
"jsdom": "^27.0.0",
58+
"knip": "^5.63.1",
6259
"lint-staged": "^16.0.0",
6360
"oxlint": "^1.8.0",
64-
"pathe": "^2.0.0",
6561
"pkg-pr-new": "^0.0.60",
6662
"postcss": "^8.4.38",
6763
"postcss-cli": "^11.0.0",
6864
"postcss-nested": "^7.0.0",
6965
"prettier": "^3.4.2",
7066
"rimraf": "^6.0.0",
7167
"rollup": "^4.22.4",
72-
"rollup-plugin-auto-external": "^2.0.0",
7368
"rollup-plugin-copy": "^3.4.0",
7469
"rollup-plugin-dts": "^6.0.0",
7570
"rollup-plugin-esbuild": "^6.0.0",
76-
"rollup-plugin-postcss": "^4.0.2",
7771
"tailwindcss": "^4.0.0",
7872
"terser": "^5.43.1",
79-
"tslib": "^2.8.1",
8073
"tsx": "^4.19.3",
81-
"typescript": "^5.4.4",
74+
"typescript": "^5.9.2",
8275
"typescript-eslint": "^8.29.1",
8376
"vite": "^7.0.0",
8477
"vitest": "^3.0.0"

packages/components/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
"dompurify": "^3.2.5",
122122
"lodash-es": "^4.17.21",
123123
"nanoid": "^5.0.9",
124-
"tslib": "^2.8.1",
125124
"unist-util-visit": "^5.0.0",
126125
"vue": "^3.5.20"
127126
},

packages/components/src/__internal__/helper.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/components/src/code-block/view/components/copy-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Icon } from '../../../__internal__/components/icon'
55
h
66
Fragment
77

8-
export type CopyButtonProps = {
8+
type CopyButtonProps = {
99
copyText: string
1010
copyIcon: string
1111
onCopy: (text: string) => void

packages/components/src/image-block/view/components/image-input.tsx

Lines changed: 0 additions & 133 deletions
This file was deleted.

packages/components/src/image-inline/components/image-inline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Attrs = {
1313
title: string
1414
}
1515

16-
export type MilkdownImageInlineProps = {
16+
type MilkdownImageInlineProps = {
1717
selected: Ref<boolean>
1818
readonly: Ref<boolean>
1919
setAttr: <T extends keyof Attrs>(attr: T, value: Attrs[T]) => void

0 commit comments

Comments
 (0)