knip 5.23.0 → 5.23.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/ConfigurationChief.d.ts +15 -89
- package/dist/ConfigurationValidator.d.ts +1141 -2897
- package/dist/DependencyDeputy.d.ts +6 -21
- 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 +9 -14
- 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 +83 -695
- package/dist/compilers/mdx.d.ts +1 -1
- package/dist/constants.d.ts +4 -4
- package/dist/index.d.ts +1 -8
- package/dist/index.js +12 -10
- package/dist/manifest/helpers.d.ts +1 -1
- package/dist/manifest/index.d.ts +6 -4
- 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/cypress/index.d.ts +1 -1
- package/dist/plugins/eleventy/helpers.d.ts +5 -5
- package/dist/plugins/eleventy/index.d.ts +2 -5
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/jest/index.d.ts +2 -3
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.d.ts +1 -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/nx/index.d.ts +1 -1
- package/dist/plugins/playwright-ct/index.d.ts +1 -1
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +1 -2
- package/dist/plugins/storybook/index.d.ts +2 -2
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/unbuild/index.d.ts +1 -2
- package/dist/plugins/vitest/helpers.d.ts +2 -2
- package/dist/plugins/webpack/index.d.ts +1 -4
- package/dist/plugins/wireit/index.d.ts +3 -2
- package/dist/plugins/yorkie/index.d.ts +1 -2
- 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 -5
- package/dist/typescript/ast-helpers.js +15 -5
- package/dist/typescript/getImportsAndExports.d.ts +10 -11
- package/dist/typescript/getImportsAndExports.js +16 -7
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportKeyword.js +26 -62
- 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 +3 -6
- package/dist/util/fs.d.ts +6 -6
- package/dist/util/get-included-issue-types.d.ts +1 -2
- 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 +1 -2
- package/dist/util/modules.d.ts +7 -7
- package/dist/util/package-json.d.ts +2 -6
- package/dist/util/path.d.ts +6 -6
- package/dist/util/pkgs-graph.d.ts +1 -1
- package/dist/util/plugin.d.ts +7 -7
- 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 +1 -6
- 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 +1 -1
package/dist/compilers/mdx.d.ts
CHANGED
package/dist/constants.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export declare const ANONYMOUS = "__anonymous";
|
|
|
5
5
|
export declare const KNIP_CONFIG_LOCATIONS: string[];
|
|
6
6
|
export declare const DEFAULT_EXTENSIONS: string[];
|
|
7
7
|
export declare const GLOBAL_IGNORE_PATTERNS: string[];
|
|
8
|
-
export declare const IGNORED_GLOBAL_BINARIES:
|
|
9
|
-
export declare const IGNORED_DEPENDENCIES:
|
|
10
|
-
export declare const IGNORED_RUNTIME_DEPENDENCIES:
|
|
11
|
-
export declare const FOREIGN_FILE_EXTENSIONS:
|
|
8
|
+
export declare const IGNORED_GLOBAL_BINARIES: any;
|
|
9
|
+
export declare const IGNORED_DEPENDENCIES: any;
|
|
10
|
+
export declare const IGNORED_RUNTIME_DEPENDENCIES: any;
|
|
11
|
+
export declare const FOREIGN_FILE_EXTENSIONS: any;
|
|
12
12
|
export declare const IGNORE_DEFINITELY_TYPED: string[];
|
|
13
13
|
export declare const ISSUE_TYPES: IssueType[];
|
|
14
14
|
export declare const ISSUE_TYPE_TITLE: Record<IssueType, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { CommandLineOptions } from './types/cli.js';
|
|
2
2
|
export type { RawConfiguration as KnipConfig } from './types/config.js';
|
|
3
3
|
export type { Preprocessor, Reporter, ReporterOptions } from './types/issues.js';
|
|
4
|
-
export declare const main: (unresolvedConfiguration: CommandLineOptions) =>
|
|
5
|
-
report: import("./types/issues.js").Report;
|
|
6
|
-
issues: import("./types/issues.js").Issues;
|
|
7
|
-
counters: import("./types/issues.js").Counters;
|
|
8
|
-
rules: import("./types/issues.js").Rules;
|
|
9
|
-
tagHints: Set<import("./types/issues.js").TagHint>;
|
|
10
|
-
configurationHints: Set<import("./types/issues.js").ConfigurationHint>;
|
|
11
|
-
}>;
|
|
4
|
+
export declare const main: (unresolvedConfiguration: CommandLineOptions) => unknown;
|
package/dist/index.js
CHANGED
|
@@ -317,8 +317,17 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
317
317
|
if (shouldIgnore(exportedItem.jsDocTags))
|
|
318
318
|
continue;
|
|
319
319
|
const isIgnored = shouldIgnoreTags(exportedItem.jsDocTags);
|
|
320
|
-
if (
|
|
320
|
+
if (importsForExport) {
|
|
321
321
|
const { isReferenced, reExportingEntryFile, traceNode } = isIdentifierReferenced(filePath, identifier, isIncludeEntryExports);
|
|
322
|
+
if ((isReferenced || exportedItem.refs[1]) && isIgnored) {
|
|
323
|
+
for (const tagName of exportedItem.jsDocTags) {
|
|
324
|
+
if (tags[1].includes(tagName.replace(/^\@/, ''))) {
|
|
325
|
+
collector.addTagHint({ type: 'tag', filePath, identifier, tagName });
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (isIgnored)
|
|
330
|
+
continue;
|
|
322
331
|
if (reExportingEntryFile) {
|
|
323
332
|
if (!isIncludeEntryExports) {
|
|
324
333
|
createAndPrintTrace(filePath, { identifier, isEntry, hasRef: isReferenced });
|
|
@@ -339,7 +348,7 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
339
348
|
continue;
|
|
340
349
|
if (member.refs[0] === 0) {
|
|
341
350
|
const id = `${identifier}.${member.identifier}`;
|
|
342
|
-
const { isReferenced } = isIdentifierReferenced(filePath, id);
|
|
351
|
+
const { isReferenced } = isIdentifierReferenced(filePath, id, true);
|
|
343
352
|
const isIgnored = shouldIgnoreTags(member.jsDocTags);
|
|
344
353
|
if (!isReferenced) {
|
|
345
354
|
if (isIgnored)
|
|
@@ -413,20 +422,13 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
413
422
|
line: exportedItem.line,
|
|
414
423
|
col: exportedItem.col,
|
|
415
424
|
});
|
|
416
|
-
if (isIssueAdded) {
|
|
425
|
+
if (isFix && isIssueAdded) {
|
|
417
426
|
if (isType)
|
|
418
427
|
fixer.addUnusedTypeNode(filePath, exportedItem.fixes);
|
|
419
428
|
else
|
|
420
429
|
fixer.addUnusedExportNode(filePath, exportedItem.fixes);
|
|
421
430
|
}
|
|
422
431
|
}
|
|
423
|
-
else if (isIgnored) {
|
|
424
|
-
for (const tagName of exportedItem.jsDocTags) {
|
|
425
|
-
if (tags[1].includes(tagName.replace(/^\@/, ''))) {
|
|
426
|
-
collector.addTagHint({ type: 'tag', filePath, identifier, tagName });
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
}
|
|
@@ -9,5 +9,5 @@ type GetFilteredScriptsOptions = {
|
|
|
9
9
|
isProduction: boolean;
|
|
10
10
|
scripts?: Scripts;
|
|
11
11
|
};
|
|
12
|
-
export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) =>
|
|
12
|
+
export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => any;
|
|
13
13
|
export {};
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { HostDependencies, InstalledBinaries } from '../types/workspace.js';
|
|
2
1
|
type Options = {
|
|
3
2
|
packageNames: string[];
|
|
4
3
|
dir: string;
|
|
5
4
|
cwd: string;
|
|
6
5
|
};
|
|
7
6
|
export declare const getDependencyMetaData: ({ cwd, dir, packageNames }: Options) => {
|
|
8
|
-
hostDependencies:
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
hostDependencies: Map<string, {
|
|
8
|
+
name: string;
|
|
9
|
+
isPeerOptional: boolean;
|
|
10
|
+
}[]>;
|
|
11
|
+
installedBinaries: Map<string, Set<string>>;
|
|
12
|
+
hasTypesIncluded: any;
|
|
11
13
|
};
|
|
12
14
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { BabelConfig, BabelConfigObj } from './types.js';
|
|
|
3
3
|
export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
enablers:
|
|
6
|
+
enablers: {}[];
|
|
7
7
|
isEnabled: IsPluginEnabled;
|
|
8
8
|
config: string[];
|
|
9
9
|
resolveConfig: ResolveConfig<BabelConfig>;
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { CapacitorConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: {}[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<CapacitorConfig>;
|
|
@@ -109,22 +109,22 @@ export declare class DummyEleventyConfig {
|
|
|
109
109
|
DateTime: {};
|
|
110
110
|
dynamicPermalinks: boolean;
|
|
111
111
|
useGitIgnore: boolean;
|
|
112
|
-
ignores:
|
|
113
|
-
watchIgnores:
|
|
112
|
+
ignores: any;
|
|
113
|
+
watchIgnores: any;
|
|
114
114
|
dataDeepMerge: boolean;
|
|
115
|
-
extensionMap:
|
|
115
|
+
extensionMap: any;
|
|
116
116
|
watchJavaScriptDependencies: boolean;
|
|
117
117
|
additionalWatchTargets: never[];
|
|
118
118
|
serverOptions: {};
|
|
119
119
|
globalData: {};
|
|
120
120
|
chokidarConfig: {};
|
|
121
121
|
watchThrottleWaitTime: number;
|
|
122
|
-
dataExtensions:
|
|
122
|
+
dataExtensions: any;
|
|
123
123
|
quietMode: boolean;
|
|
124
124
|
plugins: never[];
|
|
125
125
|
_pluginExecution: boolean;
|
|
126
126
|
useTemplateCache: boolean;
|
|
127
|
-
dataFilterSelectors:
|
|
127
|
+
dataFilterSelectors: any;
|
|
128
128
|
libraryAmendments: {};
|
|
129
129
|
serverPassthroughCopyBehavior: string;
|
|
130
130
|
urlTransforms: never[];
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
-
import { DummyEleventyConfig } from './helpers.js';
|
|
3
|
-
import type { EleventyConfig } from './types.js';
|
|
4
|
-
type T = Partial<EleventyConfig> | ((arg: DummyEleventyConfig) => Promise<Partial<EleventyConfig>>);
|
|
5
2
|
declare const _default: {
|
|
6
3
|
title: string;
|
|
7
4
|
enablers: string[];
|
|
8
5
|
isEnabled: IsPluginEnabled;
|
|
9
6
|
config: string[];
|
|
10
7
|
production: string[];
|
|
11
|
-
resolveEntryPaths: ResolveEntryPaths<
|
|
12
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveEntryPaths: ResolveEntryPaths<any>;
|
|
9
|
+
resolveConfig: ResolveConfig<any>;
|
|
13
10
|
};
|
|
14
11
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { GraphqlCodegenTypes, GraphqlConfigTypes, GraphqlProjectsConfigTypes } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: {}[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
|
|
8
8
|
config: string[];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
-
import type { JestConfig } from './types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: string[];
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
config: string[];
|
|
8
7
|
entry: string[];
|
|
9
|
-
resolveEntryPaths: ResolveEntryPaths<
|
|
10
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveEntryPaths: ResolveEntryPaths<any>;
|
|
9
|
+
resolveConfig: ResolveConfig<any>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
-
import type { LintStagedConfig } from './types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: string[];
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
packageJsonPath: string;
|
|
8
7
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<any>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getArgumentValues: (value: string, matcher: RegExp) =>
|
|
1
|
+
export declare const getArgumentValues: (value: string, matcher: RegExp) => any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FunctionsConfig } from './types.js';
|
|
2
|
-
export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) =>
|
|
2
|
+
export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) => any[];
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
|
|
|
2
2
|
import type { NetlifyConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: {}[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
production: string[];
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { NxConfigRoot, NxProjectConfiguration } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: {}[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
-
import type { PluginConfig } from './types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: import("#p/types/config.js").IgnorePatterns;
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
packageJsonPath: string;
|
|
8
7
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<any>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -2,10 +2,10 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
|
|
|
2
2
|
import type { StorybookConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: {}[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
entry:
|
|
8
|
+
entry: any[];
|
|
9
9
|
project: string[];
|
|
10
10
|
resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
|
|
11
11
|
resolveConfig: ResolveConfig<StorybookConfig>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
-
import type { UnbuildConfig } from './types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: string[];
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
config: string[];
|
|
8
|
-
resolveConfig: ResolveConfig<
|
|
7
|
+
resolveConfig: ResolveConfig<any>;
|
|
9
8
|
};
|
|
10
9
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViteConfig } from './types.js';
|
|
2
|
-
export declare const getEnvPackageName: (env: string) =>
|
|
3
|
-
export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) =>
|
|
2
|
+
export declare const getEnvPackageName: (env: string) => any;
|
|
3
|
+
export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) => any;
|
|
@@ -3,10 +3,7 @@ import type { WebpackConfig } from './types.js';
|
|
|
3
3
|
export declare const findWebpackDependenciesFromConfig: ({ config, cwd }: {
|
|
4
4
|
config: WebpackConfig;
|
|
5
5
|
cwd: string;
|
|
6
|
-
}) =>
|
|
7
|
-
dependencies: Set<string>;
|
|
8
|
-
entryPatterns: Set<string>;
|
|
9
|
-
}>;
|
|
6
|
+
}) => unknown;
|
|
10
7
|
declare const _default: {
|
|
11
8
|
title: string;
|
|
12
9
|
enablers: string[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
-
import type { WireitConfig } from './types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: string[];
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
packageJsonPath: string;
|
|
8
7
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<Record<string, {
|
|
9
|
+
command?: string;
|
|
10
|
+
}>>;
|
|
10
11
|
};
|
|
11
12
|
export default _default;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
-
import type { LintStagedConfig } from '../lint-staged/types.js';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
enablers: string[];
|
|
6
5
|
isEnabled: IsPluginEnabled;
|
|
7
6
|
packageJsonPath: string;
|
|
8
7
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<any>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -2,7 +2,7 @@ declare const _default: {
|
|
|
2
2
|
symbols: ({ report, issues, tagHints, configurationHints, noConfigHints, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
3
3
|
compact: ({ report, issues, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
4
4
|
codeowners: ({ report, issues, isShowProgress, options }: import("../index.js").ReporterOptions) => void;
|
|
5
|
-
json: ({ report, issues, options }: import("../index.js").ReporterOptions) =>
|
|
5
|
+
json: ({ report, issues, options }: import("../index.js").ReporterOptions) => any;
|
|
6
6
|
markdown: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
package/dist/reporters/json.d.ts
CHANGED
package/dist/reporters/util.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISSUE_TYPE_TITLE } from '../constants.js';
|
|
2
2
|
import type { Issue, IssueSeverity, IssueSymbol } from '../types/issues.js';
|
|
3
3
|
export declare const identity: (text: string) => string;
|
|
4
|
-
export declare const getTitle: (reportType: keyof typeof ISSUE_TYPE_TITLE) => string
|
|
4
|
+
export declare const getTitle: (reportType: keyof typeof ISSUE_TYPE_TITLE) => Record<keyof import("../types/issues.js").Issues, string>;
|
|
5
5
|
export declare const logTitle: (title: string, count: number) => void;
|
|
6
6
|
type LogIssueLine = {
|
|
7
7
|
owner?: string;
|
|
@@ -6,14 +6,14 @@ interface SourceFileManagerOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class SourceFileManager {
|
|
8
8
|
isSkipLibs: boolean;
|
|
9
|
-
sourceFileCache:
|
|
10
|
-
snapshotCache:
|
|
9
|
+
sourceFileCache: any;
|
|
10
|
+
snapshotCache: any;
|
|
11
11
|
syncCompilers: SyncCompilers;
|
|
12
12
|
asyncCompilers: AsyncCompilers;
|
|
13
13
|
constructor({ compilers, isSkipLibs }: SourceFileManagerOptions);
|
|
14
14
|
createSourceFile(filePath: string, contents: string): ts.SourceFile;
|
|
15
|
-
getSourceFile(filePath: string):
|
|
16
|
-
getSnapshot(filePath: string):
|
|
17
|
-
compileAndAddSourceFile(filePath: string):
|
|
15
|
+
getSourceFile(filePath: string): any;
|
|
16
|
+
getSnapshot(filePath: string): any;
|
|
17
|
+
compileAndAddSourceFile(filePath: string): any;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -6,11 +6,11 @@ export declare function isAccessExpression(node: ts.Node): node is ts.AccessExpr
|
|
|
6
6
|
export declare function isImportCall(node: ts.Node): node is ts.ImportCall;
|
|
7
7
|
export declare function isRequireCall(callExpression: ts.Node): callExpression is ts.CallExpression;
|
|
8
8
|
export declare function isPropertyAccessCall(node: ts.Node, identifier: string): node is ts.CallExpression;
|
|
9
|
-
export declare function stripQuotes(name: string):
|
|
9
|
+
export declare function stripQuotes(name: string): any;
|
|
10
10
|
export declare function findAncestor<T>(node: ts.Node | undefined, callback: (element: ts.Node) => boolean | 'STOP'): T | undefined;
|
|
11
11
|
export declare function findDescendants<T>(node: ts.Node | undefined, callback: (element: ts.Node) => boolean | 'STOP'): T[];
|
|
12
12
|
export declare const isDeclarationFileExtension: (extension: string) => extension is ".d.ts" | ".d.mts" | ".d.cts";
|
|
13
|
-
export declare const getJSDocTags: (node: ts.Node) =>
|
|
13
|
+
export declare const getJSDocTags: (node: ts.Node) => any;
|
|
14
14
|
export declare const getLineAndCharacterOfPosition: (node: ts.Node, pos: number) => {
|
|
15
15
|
line: number;
|
|
16
16
|
col: number;
|
|
@@ -18,9 +18,11 @@ export declare const getLineAndCharacterOfPosition: (node: ts.Node, pos: number)
|
|
|
18
18
|
};
|
|
19
19
|
export declare const getAccessMembers: (typeChecker: ts.TypeChecker, node: ts.Identifier) => string[];
|
|
20
20
|
export declare const isDestructuring: (node: ts.Node) => boolean;
|
|
21
|
-
export declare const getDestructuredIds: (name: ts.ObjectBindingPattern) =>
|
|
22
|
-
export declare const isConsiderReferencedNS: (node: ts.Identifier) =>
|
|
21
|
+
export declare const getDestructuredIds: (name: ts.ObjectBindingPattern) => any;
|
|
22
|
+
export declare const isConsiderReferencedNS: (node: ts.Identifier) => any;
|
|
23
23
|
export declare const isTopLevel: (node: ts.Node) => boolean;
|
|
24
24
|
export declare const getTypeName: (node: ts.Identifier) => ts.QualifiedName | undefined;
|
|
25
25
|
export declare const isImportSpecifier: (node: ts.Node) => boolean;
|
|
26
|
-
export declare const isReferencedInExportedType: (node: ts.Node
|
|
26
|
+
export declare const isReferencedInExportedType: (node: ts.Node) => any;
|
|
27
|
+
export declare const getExportKeywordNode: (node: ts.Node) => any;
|
|
28
|
+
export declare const getDefaultKeywordNode: (node: ts.Node) => any;
|
|
@@ -152,11 +152,21 @@ export const isImportSpecifier = (node) => ts.isImportSpecifier(node.parent) ||
|
|
|
152
152
|
ts.isImportClause(node.parent) ||
|
|
153
153
|
ts.isNamespaceImport(node.parent);
|
|
154
154
|
const isExported = (node) => {
|
|
155
|
-
if (node
|
|
155
|
+
if (getExportKeywordNode(node))
|
|
156
156
|
return true;
|
|
157
157
|
return node.parent ? isExported(node.parent) : false;
|
|
158
158
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
const isTypeDeclaration = (node) => ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node) || ts.isEnumDeclaration(node);
|
|
160
|
+
const getAncestorTypeDeclaration = (node) => {
|
|
161
|
+
while (node) {
|
|
162
|
+
if (isTypeDeclaration(node))
|
|
163
|
+
return node;
|
|
164
|
+
node = node.parent;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
export const isReferencedInExportedType = (node) => {
|
|
168
|
+
const typeNode = getAncestorTypeDeclaration(node);
|
|
169
|
+
return Boolean(typeNode && isExported(typeNode));
|
|
170
|
+
};
|
|
171
|
+
export const getExportKeywordNode = (node) => node.modifiers?.find(mod => mod.kind === ts.SyntaxKind.ExportKeyword);
|
|
172
|
+
export const getDefaultKeywordNode = (node) => node.modifiers?.find(mod => mod.kind === ts.SyntaxKind.DefaultKeyword);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type { Tags } from '../types/cli.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { IssueSymbol } from '../types/issues.js';
|
|
3
|
+
import type { Export } from '../types/dependency-graph.js';
|
|
5
4
|
import type { BoundSourceFile } from './SourceFile.js';
|
|
6
5
|
export type GetImportsAndExportsOptions = {
|
|
7
6
|
skipTypeOnly: boolean;
|
|
@@ -14,16 +13,16 @@ export type GetImportsAndExportsOptions = {
|
|
|
14
13
|
};
|
|
15
14
|
export declare const _getImportsAndExports: (sourceFile: BoundSourceFile, resolveModule: (specifier: string) => ts.ResolvedModuleFull | undefined, typeChecker: ts.TypeChecker, options: GetImportsAndExportsOptions) => {
|
|
16
15
|
imports: {
|
|
17
|
-
internal:
|
|
18
|
-
external:
|
|
19
|
-
resolved:
|
|
20
|
-
specifiers:
|
|
21
|
-
unresolved:
|
|
16
|
+
internal: Map<string, import("../types/dependency-graph.js").ImportDetails>;
|
|
17
|
+
external: any;
|
|
18
|
+
resolved: any;
|
|
19
|
+
specifiers: any;
|
|
20
|
+
unresolved: any;
|
|
22
21
|
};
|
|
23
22
|
exports: {
|
|
24
|
-
exported:
|
|
25
|
-
duplicate:
|
|
23
|
+
exported: Map<string, Export>;
|
|
24
|
+
duplicate: any[];
|
|
26
25
|
};
|
|
27
|
-
scripts:
|
|
28
|
-
traceRefs:
|
|
26
|
+
scripts: any;
|
|
27
|
+
traceRefs: any;
|
|
29
28
|
};
|