knip 4.3.0 → 4.3.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/dist/IssueFixer.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare class IssueFixer {
|
|
|
13
13
|
cwd: string;
|
|
14
14
|
fixTypes: string[];
|
|
15
15
|
});
|
|
16
|
-
addUnusedTypeNode(filePath: string,
|
|
17
|
-
addUnusedExportNode(filePath: string,
|
|
16
|
+
addUnusedTypeNode(filePath: string, fixes: Fixes | undefined): void;
|
|
17
|
+
addUnusedExportNode(filePath: string, fixes: Fixes | undefined): void;
|
|
18
18
|
fixIssues(issues: Issues): Promise<void>;
|
|
19
19
|
private removeUnusedExportKeywords;
|
|
20
20
|
private removeUnusedDependencies;
|
package/dist/IssueFixer.js
CHANGED
|
@@ -16,21 +16,21 @@ export class IssueFixer {
|
|
|
16
16
|
this.isFixUnusedTypes = fixTypes.length === 0 || fixTypes.includes('types');
|
|
17
17
|
this.isFixUnusedExports = fixTypes.length === 0 || fixTypes.includes('exports');
|
|
18
18
|
}
|
|
19
|
-
addUnusedTypeNode(filePath,
|
|
20
|
-
if (
|
|
19
|
+
addUnusedTypeNode(filePath, fixes) {
|
|
20
|
+
if (!fixes || fixes.length === 0)
|
|
21
21
|
return;
|
|
22
22
|
if (this.unusedTypeNodes.has(filePath))
|
|
23
|
-
|
|
23
|
+
fixes.forEach(fix => this.unusedTypeNodes.get(filePath).add(fix));
|
|
24
24
|
else
|
|
25
|
-
this.unusedTypeNodes.set(filePath, new Set(
|
|
25
|
+
this.unusedTypeNodes.set(filePath, new Set(fixes));
|
|
26
26
|
}
|
|
27
|
-
addUnusedExportNode(filePath,
|
|
28
|
-
if (
|
|
27
|
+
addUnusedExportNode(filePath, fixes) {
|
|
28
|
+
if (!fixes || fixes.length === 0)
|
|
29
29
|
return;
|
|
30
30
|
if (this.unusedExportNodes.has(filePath))
|
|
31
|
-
|
|
31
|
+
fixes.forEach(fix => this.unusedExportNodes.get(filePath).add(fix));
|
|
32
32
|
else
|
|
33
|
-
this.unusedExportNodes.set(filePath, new Set(
|
|
33
|
+
this.unusedExportNodes.set(filePath, new Set(fixes));
|
|
34
34
|
}
|
|
35
35
|
async fixIssues(issues) {
|
|
36
36
|
await this.removeUnusedExportKeywords();
|
|
@@ -52,7 +52,10 @@ const commands = [
|
|
|
52
52
|
'why',
|
|
53
53
|
];
|
|
54
54
|
export const resolve = (_binary, args, { manifestScriptNames }) => {
|
|
55
|
-
const parsed = parseArgs(args, {
|
|
55
|
+
const parsed = parseArgs(args, {
|
|
56
|
+
boolean: ['recursive', 'silent', 'shell-mode'],
|
|
57
|
+
alias: { recursive: 'r', silent: 's', 'shell-mode': 'c' },
|
|
58
|
+
});
|
|
56
59
|
const [command, binary] = parsed._;
|
|
57
60
|
if (manifestScriptNames.has(command) || commands.includes(command))
|
|
58
61
|
return [];
|
|
@@ -53,7 +53,7 @@ export const findVitestDependencies = async (configFilePath, localConfig, option
|
|
|
53
53
|
const dependencies = (typeof entry === 'string' ? [entry] : Object.values(entry)).map(specifier => resolveEntry(configFilePath, specifier));
|
|
54
54
|
if (!options.enabledPlugins.includes('vitest'))
|
|
55
55
|
return dependencies;
|
|
56
|
-
return [...dependencies, ...findConfigDependencies(configFilePath, localConfig, options)];
|
|
56
|
+
return compact([...dependencies, ...findConfigDependencies(configFilePath, localConfig, options)]);
|
|
57
57
|
};
|
|
58
58
|
const findVitestWorkspaceDependencies = async (configFilePath, options) => {
|
|
59
59
|
const localConfig = await load(configFilePath);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.3.
|
|
1
|
+
export declare const version = "4.3.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.3.
|
|
1
|
+
export const version = '4.3.1';
|