knip 5.22.3 → 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 +7 -4
- package/dist/IssueCollector.js +7 -2
- 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/cli.js +2 -1
- 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 -7
- package/dist/index.js +45 -11
- 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 +2 -2
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/symbols.d.ts +1 -1
- package/dist/reporters/symbols.js +18 -8
- package/dist/reporters/util.d.ts +1 -1
- package/dist/types/dependency-graph.d.ts +2 -2
- package/dist/types/issues.d.ts +9 -0
- package/dist/typescript/SourceFileManager.d.ts +5 -5
- package/dist/typescript/ast-helpers.d.ts +7 -4
- package/dist/typescript/ast-helpers.js +19 -0
- package/dist/typescript/getImportsAndExports.d.ts +10 -11
- package/dist/typescript/getImportsAndExports.js +48 -27
- 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 -2
- package/dist/util/regex.js +2 -0
- 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 +3 -2
- package/dist/util/tag.js +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,10 +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
|
-
configurationHints: Set<import("./types/issues.js").ConfigurationHint>;
|
|
10
|
-
}>;
|
|
4
|
+
export declare const main: (unresolvedConfiguration: CommandLineOptions) => unknown;
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { getIsIdentifierReferencedHandler } from './util/is-identifier-reference
|
|
|
22
22
|
import { getEntryPathFromManifest, getPackageNameFromModuleSpecifier } from './util/modules.js';
|
|
23
23
|
import { dirname, join, toPosix } from './util/path.js';
|
|
24
24
|
import { findMatch } from './util/regex.js';
|
|
25
|
-
import { getShouldIgnoreHandler } from './util/tag.js';
|
|
25
|
+
import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from './util/tag.js';
|
|
26
26
|
import { augmentWorkspace, getToSourcePathHandler } from './util/to-source-path.js';
|
|
27
27
|
import { createAndPrintTrace, printTrace } from './util/trace.js';
|
|
28
28
|
import { loadTSConfig } from './util/tsconfig-loader.js';
|
|
@@ -285,12 +285,15 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
285
285
|
if (isIsolateWorkspaces)
|
|
286
286
|
for (const principal of principals)
|
|
287
287
|
factory.deletePrincipal(principal);
|
|
288
|
-
const shouldIgnore = getShouldIgnoreHandler(
|
|
288
|
+
const shouldIgnore = getShouldIgnoreHandler(isProduction);
|
|
289
|
+
const shouldIgnoreTags = getShouldIgnoreTagHandler(tags);
|
|
289
290
|
const isIdentifierReferenced = getIsIdentifierReferencedHandler(graph, entryPaths);
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
const ignoreExportsUsedInFile = chief.config.ignoreExportsUsedInFile;
|
|
292
|
+
const isExportedItemReferenced = (exportedItem) => exportedItem.refs[1] ||
|
|
293
|
+
(exportedItem.refs[0] > 0 &&
|
|
294
|
+
(typeof ignoreExportsUsedInFile === 'object'
|
|
295
|
+
? exportedItem.type !== 'unknown' && !!ignoreExportsUsedInFile[exportedItem.type]
|
|
296
|
+
: ignoreExportsUsedInFile));
|
|
294
297
|
const findUnusedExports = async () => {
|
|
295
298
|
if (isReportValues || isReportTypes) {
|
|
296
299
|
streamer.cast('Connecting the dots...');
|
|
@@ -313,8 +316,18 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
313
316
|
continue;
|
|
314
317
|
if (shouldIgnore(exportedItem.jsDocTags))
|
|
315
318
|
continue;
|
|
319
|
+
const isIgnored = shouldIgnoreTags(exportedItem.jsDocTags);
|
|
316
320
|
if (importsForExport) {
|
|
317
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;
|
|
318
331
|
if (reExportingEntryFile) {
|
|
319
332
|
if (!isIncludeEntryExports) {
|
|
320
333
|
createAndPrintTrace(filePath, { identifier, isEntry, hasRef: isReferenced });
|
|
@@ -333,10 +346,13 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
333
346
|
continue;
|
|
334
347
|
if (shouldIgnore(member.jsDocTags))
|
|
335
348
|
continue;
|
|
336
|
-
if (member.refs === 0) {
|
|
349
|
+
if (member.refs[0] === 0) {
|
|
337
350
|
const id = `${identifier}.${member.identifier}`;
|
|
338
|
-
const { isReferenced } = isIdentifierReferenced(filePath, id);
|
|
351
|
+
const { isReferenced } = isIdentifierReferenced(filePath, id, true);
|
|
352
|
+
const isIgnored = shouldIgnoreTags(member.jsDocTags);
|
|
339
353
|
if (!isReferenced) {
|
|
354
|
+
if (isIgnored)
|
|
355
|
+
continue;
|
|
340
356
|
collector.addIssue({
|
|
341
357
|
type: 'enumMembers',
|
|
342
358
|
filePath,
|
|
@@ -348,12 +364,28 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
348
364
|
col: member.col,
|
|
349
365
|
});
|
|
350
366
|
}
|
|
367
|
+
else if (isIgnored) {
|
|
368
|
+
for (const tagName of exportedItem.jsDocTags) {
|
|
369
|
+
if (tags[1].includes(tagName.replace(/^\@/, ''))) {
|
|
370
|
+
collector.addTagHint({ type: 'tag', filePath, identifier: id, tagName });
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
351
374
|
}
|
|
352
375
|
}
|
|
353
376
|
}
|
|
354
377
|
if (principal && isReportClassMembers && exportedItem.type === 'class') {
|
|
355
378
|
const members = exportedItem.members.filter(member => !(findMatch(workspace.ignoreMembers, member.identifier) || shouldIgnore(member.jsDocTags)));
|
|
356
379
|
for (const member of principal.findUnusedMembers(filePath, members)) {
|
|
380
|
+
if (shouldIgnoreTags(member.jsDocTags)) {
|
|
381
|
+
const identifier = `${exportedItem.identifier}.${member.identifier}`;
|
|
382
|
+
for (const tagName of exportedItem.jsDocTags) {
|
|
383
|
+
if (tags[1].includes(tagName.replace(/^\@/, ''))) {
|
|
384
|
+
collector.addTagHint({ type: 'tag', filePath, identifier, tagName });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
357
389
|
collector.addIssue({
|
|
358
390
|
type: 'classMembers',
|
|
359
391
|
filePath,
|
|
@@ -374,6 +406,8 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
374
406
|
if (hasStrictlyNsRefs && ((!report.nsTypes && isType) || !(report.nsExports || isType)))
|
|
375
407
|
continue;
|
|
376
408
|
if (!isExportedItemReferenced(exportedItem)) {
|
|
409
|
+
if (isIgnored)
|
|
410
|
+
continue;
|
|
377
411
|
if (!isSkipLibs && principal?.hasExternalReferences(filePath, exportedItem))
|
|
378
412
|
continue;
|
|
379
413
|
const type = getType(hasStrictlyNsRefs, isType);
|
|
@@ -388,7 +422,7 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
388
422
|
line: exportedItem.line,
|
|
389
423
|
col: exportedItem.col,
|
|
390
424
|
});
|
|
391
|
-
if (isIssueAdded) {
|
|
425
|
+
if (isFix && isIssueAdded) {
|
|
392
426
|
if (isType)
|
|
393
427
|
fixer.addUnusedTypeNode(filePath, exportedItem.fixes);
|
|
394
428
|
else
|
|
@@ -523,7 +557,7 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
523
557
|
});
|
|
524
558
|
}
|
|
525
559
|
await findUnusedExports();
|
|
526
|
-
const { issues, counters, configurationHints } = collector.getIssues();
|
|
560
|
+
const { issues, counters, tagHints, configurationHints } = collector.getIssues();
|
|
527
561
|
if (isFix) {
|
|
528
562
|
await fixer.fixIssues(issues);
|
|
529
563
|
}
|
|
@@ -531,5 +565,5 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
531
565
|
watchReporter({ report, issues, streamer, size: analyzedFiles.size, isDebug });
|
|
532
566
|
else
|
|
533
567
|
streamer.clear();
|
|
534
|
-
return { report, issues, counters, rules, configurationHints };
|
|
568
|
+
return { report, issues, counters, rules, tagHints, configurationHints };
|
|
535
569
|
};
|
|
@@ -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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
symbols: ({ report, issues, configurationHints, noConfigHints, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
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
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReporterOptions } from '../types/issues.js';
|
|
2
|
-
declare const _default: ({ report, issues, configurationHints, noConfigHints, isShowProgress }: ReporterOptions) => void;
|
|
2
|
+
declare const _default: ({ report, issues, tagHints, configurationHints, noConfigHints, isShowProgress }: ReporterOptions) => void;
|
|
3
3
|
export default _default;
|
|
@@ -20,7 +20,7 @@ const logIssueRecord = (issues) => {
|
|
|
20
20
|
}
|
|
21
21
|
console.log(table.sort(['filePath', 'parentSymbol', 'symbol']).print().trim());
|
|
22
22
|
};
|
|
23
|
-
export default ({ report, issues, configurationHints, noConfigHints, isShowProgress }) => {
|
|
23
|
+
export default ({ report, issues, tagHints, configurationHints, noConfigHints, isShowProgress }) => {
|
|
24
24
|
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
25
25
|
let totalIssues = 0;
|
|
26
26
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
@@ -52,13 +52,23 @@ export default ({ report, issues, configurationHints, noConfigHints, isShowProgr
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
if (!noConfigHints
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
if (!noConfigHints) {
|
|
56
|
+
if (configurationHints.size > 0) {
|
|
57
|
+
logTitle('Configuration issues', configurationHints.size);
|
|
58
|
+
for (const hint of configurationHints) {
|
|
59
|
+
const { type, workspaceName, identifier } = hint;
|
|
60
|
+
const message = `Unused item in ${type}`;
|
|
61
|
+
const workspace = workspaceName && workspaceName !== ROOT_WORKSPACE_NAME ? ` (workspace: ${workspaceName})` : '';
|
|
62
|
+
console.warn(picocolors.gray(`${message}${workspace}:`), identifier);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (tagHints.size > 0) {
|
|
66
|
+
logTitle('Tag issues', tagHints.size);
|
|
67
|
+
for (const hint of tagHints) {
|
|
68
|
+
const { filePath, identifier, tagName } = hint;
|
|
69
|
+
const message = `Unused tag in ${toRelative(filePath)}:`;
|
|
70
|
+
console.warn(picocolors.gray(message), `${identifier} → ${tagName}`);
|
|
71
|
+
}
|
|
62
72
|
}
|
|
63
73
|
}
|
|
64
74
|
if (totalIssues === 0 && isShowProgress) {
|
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;
|
|
@@ -33,7 +33,7 @@ export interface Export {
|
|
|
33
33
|
type: SymbolType;
|
|
34
34
|
members: ExportMember[];
|
|
35
35
|
jsDocTags: Tags;
|
|
36
|
-
refs: number;
|
|
36
|
+
refs: [number, boolean];
|
|
37
37
|
fixes: Fixes;
|
|
38
38
|
symbol?: ts.Symbol;
|
|
39
39
|
isReExport: boolean;
|
|
@@ -44,7 +44,7 @@ export type ExportMember = {
|
|
|
44
44
|
line: number;
|
|
45
45
|
col: number;
|
|
46
46
|
type: SymbolType;
|
|
47
|
-
refs: number;
|
|
47
|
+
refs: [number, boolean];
|
|
48
48
|
fix: Fix;
|
|
49
49
|
symbol?: ts.Symbol;
|
|
50
50
|
jsDocTags: Tags;
|
package/dist/types/issues.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export type ReporterOptions = {
|
|
|
56
56
|
report: Report;
|
|
57
57
|
issues: Issues;
|
|
58
58
|
counters: Counters;
|
|
59
|
+
tagHints: TagHints;
|
|
59
60
|
configurationHints: ConfigurationHints;
|
|
60
61
|
noConfigHints: boolean;
|
|
61
62
|
cwd: string;
|
|
@@ -74,3 +75,11 @@ export type ConfigurationHint = {
|
|
|
74
75
|
identifier: string | RegExp;
|
|
75
76
|
workspaceName?: string;
|
|
76
77
|
};
|
|
78
|
+
type TagHints = Set<TagHint>;
|
|
79
|
+
export type TagHint = {
|
|
80
|
+
type: 'tag';
|
|
81
|
+
filePath: string;
|
|
82
|
+
identifier: string;
|
|
83
|
+
tagName: string;
|
|
84
|
+
};
|
|
85
|
+
export {};
|