@yuu1111/knip-config 0.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +61 -0
- package/README.md +2 -0
- package/application.ts +1 -0
- package/base.ts +1 -0
- package/library.ts +1 -0
- package/package.json +38 -37
package/README.ja.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[English](README.md)
|
|
2
|
+
|
|
3
|
+
# @yuu1111/knip-config
|
|
4
|
+
|
|
5
|
+
共有の [Knip](https://knip.dev/) 設定
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add -D @yuu1111/knip-config knip
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Knipは `knip.ts` を読むため、Projectに合うpresetをimportしてProject固有のentryを足す
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { application } from "@yuu1111/knip-config/application"
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
...application,
|
|
22
|
+
entry: ["src/main.ts"]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Presets
|
|
27
|
+
|
|
28
|
+
| Preset | Use case |
|
|
29
|
+
|--------|----------|
|
|
30
|
+
| `base` | 共有の既定値 |
|
|
31
|
+
| `application` | entry pointをframeworkが解決するapplication |
|
|
32
|
+
| `library` | entry pointが公開APIそのものであるlibrary |
|
|
33
|
+
|
|
34
|
+
### base
|
|
35
|
+
|
|
36
|
+
- `ignoreExportsUsedInFile` は自分のfile内だけで参照されるexportを報告から外す
|
|
37
|
+
|
|
38
|
+
### application
|
|
39
|
+
|
|
40
|
+
- applicationのentry pointは公開契約ではないため `includeEntryExports` はoffのままにする
|
|
41
|
+
|
|
42
|
+
### library
|
|
43
|
+
|
|
44
|
+
- 公開APIから外れたexportを報告するため `includeEntryExports` をonにする
|
|
45
|
+
|
|
46
|
+
## Notes
|
|
47
|
+
|
|
48
|
+
動的なentry point、CLI binary、生成物は共有presetがProject構成から推測できないため利用Project側に残す
|
|
49
|
+
|
|
50
|
+
別Projectを同居させているrepositoryは `ignore` でそのProjectを報告から外し、親のsourceとして読ませない
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { application } from "@yuu1111/knip-config/application"
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
...application,
|
|
57
|
+
ignore: ["FFXIVReplayAnalyzer/**"]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
そのrepositoryではpresetだけで未使用exportが48件から41件になり、入れ子Projectを外すとrepositoryに本当に残った未使用type 1件まで減った
|
package/README.md
CHANGED
package/application.ts
CHANGED
package/base.ts
CHANGED
package/library.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuu1111/knip-config",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Shared Knip configuration",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/yuu1111/configs.git",
|
|
9
|
+
"directory": "packages/knip-config"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
"./application": "./application.ts",
|
|
14
|
+
"./base": "./base.ts",
|
|
15
|
+
"./library": "./library.ts"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"README.ja.md",
|
|
19
|
+
"application.ts",
|
|
20
|
+
"base.ts",
|
|
21
|
+
"library.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"knip",
|
|
25
|
+
"config"
|
|
26
|
+
],
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"knip": ">=5.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependenciesMeta": {
|
|
31
|
+
"knip": {
|
|
32
|
+
"optional": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"knip": "^6.34.0"
|
|
37
|
+
}
|
|
38
|
+
}
|