@yuu1111/knip-config 1.0.1 → 1.0.3
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 +2 -3
- package/README.md +1 -5
- package/application.ts +3 -2
- package/base.ts +5 -1
- package/library.ts +4 -2
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
### base
|
|
35
35
|
|
|
36
36
|
- `ignoreExportsUsedInFile` は自分のfile内だけで参照されるexportを報告から外す
|
|
37
|
+
- `ignoreFiles` は `quality-check` が実行時に読み込む `quality.config.ts` を報告から外す
|
|
37
38
|
|
|
38
39
|
### application
|
|
39
40
|
|
|
@@ -54,8 +55,6 @@ import { application } from "@yuu1111/knip-config/application"
|
|
|
54
55
|
|
|
55
56
|
export default {
|
|
56
57
|
...application,
|
|
57
|
-
ignore: ["
|
|
58
|
+
ignore: ["another-project/**"]
|
|
58
59
|
}
|
|
59
60
|
```
|
|
60
|
-
|
|
61
|
-
そのrepositoryではpresetだけで未使用exportが48件から41件になり、入れ子Projectを外すとrepositoryに本当に残った未使用type 1件まで減った
|
package/README.md
CHANGED
|
@@ -57,10 +57,6 @@ import { application } from "@yuu1111/knip-config/application"
|
|
|
57
57
|
|
|
58
58
|
export default {
|
|
59
59
|
...application,
|
|
60
|
-
ignore: ["
|
|
60
|
+
ignore: ["another-project/**"]
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
|
-
|
|
64
|
-
On such a repository the preset alone took the unused exports from 48 to 41,
|
|
65
|
-
and the nested project took the report down to the single unused type that the
|
|
66
|
-
repository really has left.
|
package/application.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { KnipConfig } from "knip";
|
|
2
2
|
import { base } from "./base";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* frameworkが動的に読み込むentryは利用Projectが明示するapplication向けのknip設定を提供する
|
|
6
|
+
*/
|
|
6
7
|
export const application = {
|
|
7
8
|
...base,
|
|
8
9
|
// applicationのentryは公開契約ではないため未使用exportとして報告しない
|
package/base.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { KnipConfig } from "knip";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* 各presetが共通で継承するbase設定を提供する
|
|
5
|
+
*/
|
|
4
6
|
export const base = {
|
|
5
7
|
// 同一file内で参照しているexportは内部利用とみなす
|
|
6
8
|
ignoreExportsUsedInFile: true,
|
|
9
|
+
// quality-checkが実行時に読み込むため、Projectのsourceとして報告しない
|
|
10
|
+
ignoreFiles: ["quality.config.ts"],
|
|
7
11
|
} satisfies KnipConfig;
|
package/library.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { KnipConfig } from "knip";
|
|
2
2
|
import { base } from "./base";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 公開APIのentryを持つlibrary向けのknip設定を提供する
|
|
6
|
+
*/
|
|
6
7
|
export const library = {
|
|
7
8
|
...base,
|
|
9
|
+
// 公開APIから外れたexportを未使用として報告する
|
|
8
10
|
includeEntryExports: true,
|
|
9
11
|
} satisfies KnipConfig;
|