knip 5.23.1 → 5.23.2
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/ConfigurationChief.d.ts +89 -15
- package/dist/ConfigurationValidator.d.ts +2897 -1141
- package/dist/DependencyDeputy.d.ts +21 -6
- package/dist/IssueCollector.d.ts +4 -4
- package/dist/IssueFixer.d.ts +1 -1
- package/dist/PrincipalFactory.d.ts +3 -3
- package/dist/ProjectPrincipal.d.ts +9 -9
- package/dist/WorkspaceWorker.d.ts +14 -9
- package/dist/binaries/util.d.ts +5 -5
- package/dist/compilers/astro.d.ts +1 -1
- package/dist/compilers/compilers.d.ts +2 -2
- package/dist/compilers/index.d.ts +695 -83
- package/dist/compilers/mdx.d.ts +1 -1
- package/dist/constants.d.ts +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/manifest/helpers.d.ts +1 -1
- package/dist/manifest/index.d.ts +4 -6
- package/dist/plugins/babel/helpers.d.ts +1 -1
- package/dist/plugins/babel/index.d.ts +1 -1
- package/dist/plugins/capacitor/index.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +2 -7
- package/dist/plugins/cypress/index.d.ts +1 -1
- package/dist/plugins/eleventy/helpers.d.ts +5 -5
- package/dist/plugins/eleventy/index.d.ts +5 -2
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.js +1 -1
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/jest/index.d.ts +3 -2
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.d.ts +2 -1
- package/dist/plugins/lint-staged/index.js +5 -6
- package/dist/plugins/linthtml/index.js +2 -9
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/markdownlint/helpers.d.ts +1 -1
- package/dist/plugins/netlify/helpers.d.ts +1 -1
- package/dist/plugins/netlify/index.d.ts +1 -1
- package/dist/plugins/next/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +2 -2
- package/dist/plugins/nx/index.d.ts +1 -1
- package/dist/plugins/playwright-ct/index.d.ts +1 -1
- package/dist/plugins/postcss/index.js +6 -2
- package/dist/plugins/prettier/index.js +2 -2
- package/dist/plugins/release-it/index.js +1 -1
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/semantic-release/index.js +2 -2
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +2 -1
- package/dist/plugins/size-limit/index.js +5 -2
- package/dist/plugins/storybook/index.d.ts +2 -2
- package/dist/plugins/stylelint/index.js +2 -2
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/syncpack/index.d.ts +1 -0
- package/dist/plugins/syncpack/index.js +5 -2
- package/dist/plugins/tsup/index.js +1 -1
- package/dist/plugins/typedoc/index.js +4 -4
- package/dist/plugins/unbuild/index.d.ts +2 -1
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vitest/helpers.d.ts +2 -2
- package/dist/plugins/webpack/index.d.ts +4 -1
- package/dist/plugins/wireit/index.d.ts +2 -3
- package/dist/plugins/xo/index.js +2 -2
- package/dist/plugins/yorkie/index.d.ts +2 -1
- package/dist/reporters/index.d.ts +1 -1
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/util.d.ts +1 -1
- package/dist/typescript/SourceFileManager.d.ts +5 -5
- package/dist/typescript/ast-helpers.d.ts +7 -7
- package/dist/typescript/getImportsAndExports.d.ts +11 -10
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/index.d.ts +1 -1
- package/dist/util/Performance.d.ts +2 -2
- package/dist/util/array.d.ts +2 -2
- package/dist/util/errors.d.ts +1 -1
- package/dist/util/file-entry-cache.d.ts +6 -3
- package/dist/util/fs.d.ts +6 -6
- package/dist/util/get-included-issue-types.d.ts +2 -1
- package/dist/util/get-included-issue-types.js +1 -1
- package/dist/util/git.d.ts +1 -1
- package/dist/util/glob.d.ts +6 -6
- package/dist/util/handle-dependency.d.ts +1 -1
- package/dist/util/is-identifier-referenced.d.ts +1 -1
- package/dist/util/loader.d.ts +1 -1
- package/dist/util/map-workspaces.d.ts +2 -1
- package/dist/util/modules.d.ts +7 -7
- package/dist/util/package-json.d.ts +6 -2
- package/dist/util/path.d.ts +6 -6
- package/dist/util/pkgs-graph.d.ts +1 -1
- package/dist/util/plugin.d.ts +33 -9
- package/dist/util/plugin.js +34 -2
- package/dist/util/protocols.d.ts +9 -9
- package/dist/util/regex.d.ts +3 -3
- package/dist/util/reporter.d.ts +1 -1
- package/dist/util/require.d.ts +3 -3
- package/dist/util/resolve.d.ts +1 -1
- package/dist/util/tag.d.ts +2 -2
- package/dist/util/trace.d.ts +2 -2
- package/dist/util/tsconfig-loader.d.ts +6 -1
- package/dist/util/unwrap-function.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Workspace } from './ConfigurationChief.js';
|
|
2
|
-
import type { Counters, Issue, Issues, SymbolIssueType } from './types/issues.js';
|
|
2
|
+
import type { ConfigurationHints, Counters, Issue, Issues, SymbolIssueType } from './types/issues.js';
|
|
3
3
|
import type { PackageJson } from './types/package-json.js';
|
|
4
4
|
import type { DependencyArray, DependencySet, HostDependencies, InstalledBinaries, WorkspaceManifests } from './types/workspace.js';
|
|
5
5
|
type Options = {
|
|
@@ -25,18 +25,33 @@ export declare class DependencyDeputy {
|
|
|
25
25
|
ignoreDependencies: (string | RegExp)[];
|
|
26
26
|
ignoreBinaries: (string | RegExp)[];
|
|
27
27
|
}): void;
|
|
28
|
-
getWorkspaceManifest(workspaceName: string):
|
|
28
|
+
getWorkspaceManifest(workspaceName: string): {
|
|
29
|
+
workspaceDir: string;
|
|
30
|
+
manifestPath: string;
|
|
31
|
+
dependencies: DependencyArray;
|
|
32
|
+
devDependencies: DependencyArray;
|
|
33
|
+
peerDependencies: DependencySet;
|
|
34
|
+
optionalPeerDependencies: DependencyArray;
|
|
35
|
+
allDependencies: DependencySet;
|
|
36
|
+
ignoreDependencies: (string | RegExp)[];
|
|
37
|
+
ignoreBinaries: (string | RegExp)[];
|
|
38
|
+
usedIgnoreDependencies: Set<string | RegExp>;
|
|
39
|
+
usedIgnoreBinaries: Set<string | RegExp>;
|
|
40
|
+
} | undefined;
|
|
29
41
|
getProductionDependencies(workspaceName: string): DependencyArray;
|
|
30
42
|
getDevDependencies(workspaceName: string): DependencyArray;
|
|
31
43
|
getDependencies(workspaceName: string): DependencySet;
|
|
32
44
|
setInstalledBinaries(workspaceName: string, installedBinaries: Map<string, Set<string>>): void;
|
|
33
|
-
getInstalledBinaries(workspaceName: string):
|
|
45
|
+
getInstalledBinaries(workspaceName: string): InstalledBinaries | undefined;
|
|
34
46
|
setHasTypesIncluded(workspaceName: string, hasTypesIncluded: Set<string>): void;
|
|
35
|
-
getHasTypesIncluded(workspaceName: string):
|
|
47
|
+
getHasTypesIncluded(workspaceName: string): InstalledBinaries | undefined;
|
|
36
48
|
addReferencedDependency(workspaceName: string, packageName: string): void;
|
|
37
49
|
addReferencedBinary(workspaceName: string, binaryName: string): void;
|
|
38
50
|
setHostDependencies(workspaceName: string, hostDependencies: HostDependencies): void;
|
|
39
|
-
getHostDependenciesFor(workspaceName: string, dependency: string):
|
|
51
|
+
getHostDependenciesFor(workspaceName: string, dependency: string): {
|
|
52
|
+
name: string;
|
|
53
|
+
isPeerOptional: boolean;
|
|
54
|
+
}[];
|
|
40
55
|
getOptionalPeerDependencies(workspaceName: string): DependencyArray;
|
|
41
56
|
maybeAddReferencedExternalDependency(workspace: Workspace, packageName: string): boolean;
|
|
42
57
|
maybeAddReferencedBinary(workspace: Workspace, binaryName: string): boolean;
|
|
@@ -51,6 +66,6 @@ export declare class DependencyDeputy {
|
|
|
51
66
|
getConfigurationHints({ issues, counters }: {
|
|
52
67
|
issues: Issues;
|
|
53
68
|
counters: Counters;
|
|
54
|
-
}):
|
|
69
|
+
}): ConfigurationHints;
|
|
55
70
|
}
|
|
56
71
|
export {};
|
package/dist/IssueCollector.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ export declare class IssueCollector {
|
|
|
28
28
|
addIssue(issue: Issue): Issue | undefined;
|
|
29
29
|
addConfigurationHint(issue: ConfigurationHint): void;
|
|
30
30
|
addTagHint(issue: TagHint): void;
|
|
31
|
-
purge():
|
|
31
|
+
purge(): import("./types/issues.js").IssueSet;
|
|
32
32
|
getIssues(): {
|
|
33
33
|
issues: import("./types/issues.js").Issues;
|
|
34
|
-
counters:
|
|
35
|
-
tagHints:
|
|
36
|
-
configurationHints:
|
|
34
|
+
counters: import("./types/issues.js").Counters;
|
|
35
|
+
tagHints: Set<TagHint>;
|
|
36
|
+
configurationHints: Set<ConfigurationHint>;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
export {};
|
package/dist/IssueFixer.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare class IssueFixer {
|
|
|
18
18
|
constructor({ isEnabled, cwd, fixTypes, isRemoveFiles }: Fixer);
|
|
19
19
|
addUnusedTypeNode(filePath: string, fixes: Fixes | undefined): void;
|
|
20
20
|
addUnusedExportNode(filePath: string, fixes: Fixes | undefined): void;
|
|
21
|
-
fixIssues(issues: Issues):
|
|
21
|
+
fixIssues(issues: Issues): Promise<void>;
|
|
22
22
|
private markExportFixed;
|
|
23
23
|
private removeUnusedFiles;
|
|
24
24
|
private removeUnusedExportKeywords;
|
|
@@ -21,12 +21,12 @@ export type PrincipalOptions = {
|
|
|
21
21
|
};
|
|
22
22
|
export declare class PrincipalFactory {
|
|
23
23
|
principals: Principals;
|
|
24
|
-
getPrincipal(options: PrincipalOptions):
|
|
24
|
+
getPrincipal(options: PrincipalOptions): ProjectPrincipal;
|
|
25
25
|
private findReusablePrincipal;
|
|
26
26
|
private linkPrincipal;
|
|
27
27
|
private addNewPrincipal;
|
|
28
|
-
getPrincipals():
|
|
29
|
-
getPrincipalByPackageName(packageName: string):
|
|
28
|
+
getPrincipals(): ProjectPrincipal[];
|
|
29
|
+
getPrincipalByPackageName(packageName: string): ProjectPrincipal | undefined;
|
|
30
30
|
deletePrincipal(principal: ProjectPrincipal): void;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -9,11 +9,11 @@ import { type GetImportsAndExportsOptions } from './typescript/getImportsAndExpo
|
|
|
9
9
|
import type { ResolveModuleNames } from './typescript/resolveModuleNames.js';
|
|
10
10
|
import type { ToSourceFilePath } from './util/to-source-path.js';
|
|
11
11
|
export declare class ProjectPrincipal {
|
|
12
|
-
entryPaths:
|
|
13
|
-
projectPaths:
|
|
14
|
-
nonEntryPaths:
|
|
12
|
+
entryPaths: Set<string>;
|
|
13
|
+
projectPaths: Set<string>;
|
|
14
|
+
nonEntryPaths: Set<string>;
|
|
15
15
|
referencedDependencies: Set<[string, string, string]>;
|
|
16
|
-
skipExportsAnalysis:
|
|
16
|
+
skipExportsAnalysis: Set<string>;
|
|
17
17
|
cwd: string;
|
|
18
18
|
compilerOptions: ts.CompilerOptions;
|
|
19
19
|
extensions: Set<string>;
|
|
@@ -45,16 +45,16 @@ export declare class ProjectPrincipal {
|
|
|
45
45
|
}): void;
|
|
46
46
|
addNonEntryPath(filePath: string): void;
|
|
47
47
|
addProjectPath(filePath: string): void;
|
|
48
|
-
deletedFiles:
|
|
48
|
+
deletedFiles: Set<unknown>;
|
|
49
49
|
removeProjectPath(filePath: string): void;
|
|
50
50
|
addReferencedDependencies(workspaceName: string, referencedDependencies: ReferencedDependencies): void;
|
|
51
|
-
runAsyncCompilers():
|
|
52
|
-
getUsedResolvedFiles():
|
|
51
|
+
runAsyncCompilers(): Promise<void>;
|
|
52
|
+
getUsedResolvedFiles(): string[];
|
|
53
53
|
private getProgramSourceFiles;
|
|
54
|
-
getUnreferencedFiles():
|
|
54
|
+
getUnreferencedFiles(): string[];
|
|
55
55
|
analyzeSourceFile(filePath: string, options: Omit<GetImportsAndExportsOptions, 'skipExports'>, isGitIgnored: (filePath: string) => boolean, isPackageNameInternalWorkspace: (packageName: string) => boolean, getPrincipalByFilePath: (filePath: string) => undefined | ProjectPrincipal): FileNode;
|
|
56
56
|
invalidateFile(filePath: string): void;
|
|
57
|
-
findUnusedMembers(filePath: string, members: ExportMember[]):
|
|
57
|
+
findUnusedMembers(filePath: string, members: ExportMember[]): ExportMember[];
|
|
58
58
|
hasExternalReferences(filePath: string, exportedItem: Export): boolean;
|
|
59
59
|
reconcileCache(graph: DependencyGraph): void;
|
|
60
60
|
}
|
|
@@ -32,23 +32,28 @@ export declare class WorkspaceWorker {
|
|
|
32
32
|
isStrict: boolean;
|
|
33
33
|
rootIgnore: Configuration['ignore'];
|
|
34
34
|
negatedWorkspacePatterns: string[];
|
|
35
|
-
enabledPluginsMap:
|
|
35
|
+
enabledPluginsMap: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lockfileLint" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "simpleGitHooks" | "sizeLimit" | "vercelOg" | "webdriverIo", boolean>;
|
|
36
36
|
enabledPlugins: PluginName[];
|
|
37
37
|
enabledPluginsInAncestors: string[];
|
|
38
38
|
cache: CacheConsultant<CacheItem>;
|
|
39
39
|
constructor({ name, dir, cwd, config, manifest, dependencies, isProduction, isStrict, rootIgnore, negatedWorkspacePatterns, enabledPluginsInAncestors, }: WorkspaceManagerOptions);
|
|
40
|
-
init():
|
|
40
|
+
init(): Promise<void>;
|
|
41
41
|
private determineEnabledPlugins;
|
|
42
42
|
private getConfigForPlugin;
|
|
43
|
-
getEntryFilePatterns():
|
|
44
|
-
getProjectFilePatterns(testFilePatterns: string[]):
|
|
45
|
-
getPluginProjectFilePatterns():
|
|
43
|
+
getEntryFilePatterns(): string[];
|
|
44
|
+
getProjectFilePatterns(testFilePatterns: string[]): string[];
|
|
45
|
+
getPluginProjectFilePatterns(): string[];
|
|
46
46
|
getPluginConfigPatterns(): string[];
|
|
47
|
-
getProductionEntryFilePatterns(negatedTestFilePatterns: string[]):
|
|
48
|
-
getProductionProjectFilePatterns(negatedTestFilePatterns: string[]):
|
|
47
|
+
getProductionEntryFilePatterns(negatedTestFilePatterns: string[]): string[];
|
|
48
|
+
getProductionProjectFilePatterns(negatedTestFilePatterns: string[]): string[];
|
|
49
49
|
private getConfigurationFilePatterns;
|
|
50
|
-
getIgnorePatterns():
|
|
51
|
-
findDependenciesByPlugins():
|
|
50
|
+
getIgnorePatterns(): string[];
|
|
51
|
+
findDependenciesByPlugins(): Promise<{
|
|
52
|
+
entryFilePatterns: Set<string>;
|
|
53
|
+
productionEntryFilePatterns: Set<string>;
|
|
54
|
+
referencedDependencies: ReferencedDependencies;
|
|
55
|
+
enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lockfileLint" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "simpleGitHooks" | "sizeLimit" | "vercelOg" | "webdriverIo")[];
|
|
56
|
+
}>;
|
|
52
57
|
onDispose(): void;
|
|
53
58
|
}
|
|
54
59
|
export {};
|
package/dist/binaries/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const tryResolveFilePath: (cwd: string, specifier: string, acceptModuleSpecifier?: boolean) =>
|
|
2
|
-
export declare const tryResolveSpecifiers: (cwd: string, specifiers: string[]) =>
|
|
3
|
-
export declare const stripVersionFromSpecifier: (specifier: string) =>
|
|
4
|
-
export declare const trimBinary: (command: string) =>
|
|
5
|
-
export declare const argsFrom: (args: string[], from: string) =>
|
|
1
|
+
export declare const tryResolveFilePath: (cwd: string, specifier: string, acceptModuleSpecifier?: boolean) => string | undefined;
|
|
2
|
+
export declare const tryResolveSpecifiers: (cwd: string, specifiers: string[]) => (string | undefined)[];
|
|
3
|
+
export declare const stripVersionFromSpecifier: (specifier: string) => string;
|
|
4
|
+
export declare const trimBinary: (command: string) => string;
|
|
5
|
+
export declare const argsFrom: (args: string[], from: string) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SyncCompilerFn } from './types.js';
|
|
2
|
-
export declare const importMatcher:
|
|
3
|
-
export declare const fencedCodeBlockMatcher:
|
|
2
|
+
export declare const importMatcher: RegExp;
|
|
3
|
+
export declare const fencedCodeBlockMatcher: RegExp;
|
|
4
4
|
export declare const importsWithinScripts: SyncCompilerFn;
|