knip 5.58.0 → 5.59.0

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.
@@ -161,6 +161,7 @@ export declare class ConfigurationChief {
161
161
  tailwind?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
162
162
  travis?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
163
163
  "ts-node"?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
164
+ tsdown?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
164
165
  tsup?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
165
166
  tsx?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
166
167
  typedoc?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -307,10 +307,11 @@ export class ConfigurationChief {
307
307
  getNegatedWorkspacePatterns(name) {
308
308
  const descendentWorkspaces = this.getDescendentWorkspaces(name);
309
309
  const matchName = new RegExp(`^${name}/`);
310
- const ignoredWorkspaces = this.getIgnoredWorkspacesFor(name).map(p => p.replace(/\/\*$/, '/**'));
310
+ const ignoredWorkspaces = this.getIgnoredWorkspacesFor(name);
311
+ const endMatch = /\/\*{1,2}$|\/$|$/;
311
312
  return [...ignoredWorkspaces, ...descendentWorkspaces]
312
313
  .map(workspaceName => workspaceName.replace(matchName, ''))
313
- .map(workspaceName => `!${workspaceName}`);
314
+ .map(workspaceName => `!${workspaceName.replace(endMatch, '/**')}`);
314
315
  }
315
316
  getConfigKeyForWorkspace(workspaceName) {
316
317
  return this.getConfiguredWorkspaceKeys()
@@ -3,7 +3,7 @@ import { compact } from '../util/array.js';
3
3
  import { toBinary, toDeferResolve, toEntry } from '../util/input.js';
4
4
  const spawningBinaries = ['cross-env', 'retry-cli'];
5
5
  const endOfCommandBinaries = ['dotenvx'];
6
- const positionals = new Set(['babel-node', 'esbuild', 'execa', 'jiti', 'vite-node', 'zx']);
6
+ const positionals = new Set(['babel-node', 'esbuild', 'execa', 'jiti', 'oxnode', 'vite-node', 'zx']);
7
7
  export const resolve = (binary, args, { fromArgs }) => {
8
8
  const parsed = parseArgs(args, { boolean: ['quiet', 'verbose'], '--': endOfCommandBinaries.includes(binary) });
9
9
  const bin = binary.startsWith('.') ? toEntry(binary) : toBinary(binary);
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import { splitTags } from './util/tag.js';
10
10
  import { isTrace } from './util/trace.js';
11
11
  import { version } from './version.js';
12
12
  const defaultCacheLocation = join(cwd, 'node_modules', '.cache', 'knip');
13
- const { 'allow-remove-files': isRemoveFiles = false, cache: isCache = false, 'cache-location': cacheLocation = defaultCacheLocation, debug: isDebug = false, dependencies: isDependenciesShorthand = false, exclude: excludedIssueTypes = [], 'experimental-tags': experimentalTags = [], exports: isExportsShorthand = false, files: isFilesShorthand = false, fix: isFix = false, format: isFormat = false, 'fix-type': fixTypes = [], help: isHelp, include: includedIssueTypes = [], 'include-entry-exports': isIncludeEntryExports = false, 'include-libs': isIncludeLibs = false, 'isolate-workspaces': isIsolateWorkspaces = false, 'max-issues': maxIssues = '0', 'memory-realtime': memoryRealtime = false, 'no-config-hints': isDisableConfigHints = false, 'no-exit-code': noExitCode = false, 'no-gitignore': isNoGitIgnore = false, 'no-progress': isNoProgress = isDebug || isTrace || memoryRealtime, preprocessor = [], 'preprocessor-options': preprocessorOptions = '', production: isProduction = false, reporter = ['symbols'], 'reporter-options': reporterOptions = '', strict: isStrict = false, tags = [], 'treat-config-hints-as-errors': treatConfigHintsAsErrors = false, tsConfig, version: isVersion, watch: isWatch = false, workspace: rawWorkspaceArg, } = parsedArgValues;
13
+ const { 'allow-remove-files': isRemoveFiles = false, cache: isCache = false, 'cache-location': cacheLocation = defaultCacheLocation, debug: isDebug = false, dependencies: isDependenciesShorthand = false, exclude: excludedIssueTypes = [], 'experimental-tags': experimentalTags = [], exports: isExportsShorthand = false, files: isFilesShorthand = false, fix: isFix = false, format: isFormat = false, 'fix-type': fixTypes = [], help: isHelp, include: includedIssueTypes = [], 'include-entry-exports': isIncludeEntryExports = false, 'include-libs': isIncludeLibs = false, 'isolate-workspaces': isIsolateWorkspaces = false, 'max-issues': maxIssues = '0', 'memory-realtime': memoryRealtime = false, 'no-config-hints': isNoConfigHints = false, 'no-exit-code': noExitCode = false, 'no-gitignore': isNoGitIgnore = false, 'no-progress': isNoProgress = isDebug || isTrace || memoryRealtime, preprocessor = [], 'preprocessor-options': preprocessorOptions = '', production: isProduction = false, reporter = ['symbols'], 'reporter-options': reporterOptions = '', strict: isStrict = false, tags = [], 'treat-config-hints-as-errors': treatConfigHintsAsErrors = false, tsConfig, version: isVersion, watch: isWatch = false, workspace: rawWorkspaceArg, } = parsedArgValues;
14
14
  if (isHelp) {
15
15
  console.log(helpText);
16
16
  process.exit(0);
@@ -37,7 +37,6 @@ const run = async () => {
37
37
  isFilesShorthand,
38
38
  isFix: isFix || fixTypes.length > 0,
39
39
  isFormat,
40
- isDisableConfigHints,
41
40
  isIncludeEntryExports,
42
41
  isIncludeLibs,
43
42
  isIsolateWorkspaces,
@@ -50,6 +49,7 @@ const run = async () => {
50
49
  tsConfigFile: tsConfig,
51
50
  workspace,
52
51
  });
52
+ const isDisableConfigHints = isNoConfigHints || isProduction || Boolean(workspace);
53
53
  if (isWatch || isTrace)
54
54
  return;
55
55
  const initialData = {
@@ -0,0 +1,6 @@
1
+ import type { HasDependency } from './types.js';
2
+ declare const _default: {
3
+ condition: (hasDependency: HasDependency) => boolean;
4
+ compiler: (text: string) => string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { fencedCodeBlockMatcher, importMatcher, importsWithinFrontmatter } from './compilers.js';
2
+ const astroMDXDependencies = ['@astrojs/mdx', '@astrojs/starlight'];
3
+ const frontmatterImportFields = ['layout'];
4
+ const condition = (hasDependency) => astroMDXDependencies.some(hasDependency);
5
+ const compiler = (text) => {
6
+ const imports = text.replace(fencedCodeBlockMatcher, '').matchAll(importMatcher);
7
+ const frontmatterImports = importsWithinFrontmatter(text, frontmatterImportFields);
8
+ return [...imports, frontmatterImports].join('\n');
9
+ };
10
+ export default { condition, compiler };
@@ -3,3 +3,4 @@ export declare const fencedCodeBlockMatcher: RegExp;
3
3
  export declare const importMatcher: RegExp;
4
4
  export declare const importsWithinScripts: SyncCompilerFn;
5
5
  export declare const scriptBodies: SyncCompilerFn;
6
+ export declare const importsWithinFrontmatter: (text: string, keys?: string[]) => string;
@@ -21,3 +21,15 @@ export const scriptBodies = (text) => {
21
21
  }
22
22
  return scripts.join(';\n');
23
23
  };
24
+ const frontmatterMatcher = /---[\s\S]*?---/;
25
+ export const importsWithinFrontmatter = (text, keys = []) => {
26
+ const frontmatter = text.match(frontmatterMatcher)?.[0];
27
+ if (!frontmatter)
28
+ return '';
29
+ const imports = keys.flatMap(key => {
30
+ const valueMatcher = new RegExp(`${key}:\\s*["']([^"']+)["']`, 'i');
31
+ const match = frontmatter.match(valueMatcher);
32
+ return match?.[1] ? [`import ${key} from "${match[1]}";`] : [];
33
+ });
34
+ return imports.join('\n');
35
+ };
@@ -454,6 +454,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
454
454
  entry?: string | string[] | undefined;
455
455
  project?: string | string[] | undefined;
456
456
  } | undefined;
457
+ tsdown?: string | boolean | string[] | {
458
+ config?: string | string[] | undefined;
459
+ entry?: string | string[] | undefined;
460
+ project?: string | string[] | undefined;
461
+ } | undefined;
457
462
  tsup?: string | boolean | string[] | {
458
463
  config?: string | string[] | undefined;
459
464
  entry?: string | string[] | undefined;
@@ -1005,6 +1010,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1005
1010
  entry?: string | string[] | undefined;
1006
1011
  project?: string | string[] | undefined;
1007
1012
  } | undefined;
1013
+ tsdown?: string | boolean | string[] | {
1014
+ config?: string | string[] | undefined;
1015
+ entry?: string | string[] | undefined;
1016
+ project?: string | string[] | undefined;
1017
+ } | undefined;
1008
1018
  tsup?: string | boolean | string[] | {
1009
1019
  config?: string | string[] | undefined;
1010
1020
  entry?: string | string[] | undefined;
@@ -1,3 +1,4 @@
1
+ import AstroMDX from './astro-mdx.js';
1
2
  import Astro from './astro.js';
2
3
  import MDX from './mdx.js';
3
4
  import Svelte from './svelte.js';
@@ -34,7 +35,10 @@ const compilers = new Map([
34
35
  export const getIncludedCompilers = (syncCompilers, asyncCompilers, dependencies) => {
35
36
  const hasDependency = (packageName) => dependencies.has(packageName);
36
37
  for (const [extension, { condition, compiler }] of compilers.entries()) {
37
- if ((!syncCompilers.has(extension) && condition(hasDependency)) || syncCompilers.get(extension) === true) {
38
+ if (extension === '.mdx' && AstroMDX.condition(hasDependency)) {
39
+ syncCompilers.set(extension, AstroMDX.compiler);
40
+ }
41
+ else if ((!syncCompilers.has(extension) && condition(hasDependency)) || syncCompilers.get(extension) === true) {
38
42
  syncCompilers.set(extension, compiler);
39
43
  }
40
44
  }
@@ -1,6 +1,5 @@
1
1
  import { fencedCodeBlockMatcher, importMatcher } from './compilers.js';
2
2
  const mdxDependencies = [
3
- 'astro',
4
3
  '@mdx-js/esbuild',
5
4
  '@mdx-js/loader',
6
5
  '@mdx-js/mdx',
@@ -17,14 +17,12 @@ interface AnalyzeOptions {
17
17
  fixer: IssueFixer;
18
18
  graph: ModuleGraph;
19
19
  isFix: boolean;
20
- isDisableConfigHints: boolean;
21
20
  isIncludeLibs: boolean;
22
21
  isProduction: boolean;
23
22
  report: Report;
24
23
  streamer: ConsoleStreamer;
25
24
  tags: Tags;
26
25
  unreferencedFiles: Set<string>;
27
- workspace?: string;
28
26
  }
29
27
  export declare const analyze: (options: AnalyzeOptions) => Promise<() => Promise<void>>;
30
28
  export {};
@@ -5,13 +5,12 @@ import { findMatch } from '../util/regex.js';
5
5
  import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from '../util/tag.js';
6
6
  import { createAndPrintTrace, printTrace } from '../util/trace.js';
7
7
  export const analyze = async (options) => {
8
- const { analyzedFiles, chief, collector, deputy, entryPaths, factory, fixer, graph, isFix, isDisableConfigHints, isIncludeLibs, isProduction, report, streamer, tags, unreferencedFiles, workspace, } = options;
8
+ const { analyzedFiles, chief, collector, deputy, entryPaths, factory, fixer, graph, isFix, isIncludeLibs, isProduction, report, streamer, tags, unreferencedFiles, } = options;
9
9
  const isReportDependencies = report.dependencies || report.unlisted || report.unresolved;
10
10
  const isReportValues = report.exports || report.nsExports || report.classMembers;
11
11
  const isReportTypes = report.types || report.nsTypes || report.enumMembers;
12
12
  const isReportClassMembers = report.classMembers;
13
13
  const isSkipLibs = !(isIncludeLibs || isReportClassMembers);
14
- const isShowConfigHints = !workspace && !isProduction && !isDisableConfigHints;
15
14
  const shouldIgnore = getShouldIgnoreHandler(isProduction);
16
15
  const shouldIgnoreTags = getShouldIgnoreTagHandler(tags);
17
16
  const isIdentifierReferenced = getIsIdentifierReferencedHandler(graph, entryPaths);
@@ -212,17 +211,13 @@ export const analyze = async (options) => {
212
211
  for (const issue of optionalPeerDependencyIssues)
213
212
  collector.addIssue(issue);
214
213
  deputy.removeIgnoredIssues(collector.getIssues());
215
- if (isShowConfigHints) {
216
- const configurationHints = deputy.getConfigurationHints();
217
- for (const hint of configurationHints)
218
- collector.addConfigurationHint(hint);
219
- }
214
+ const configurationHints = deputy.getConfigurationHints();
215
+ for (const hint of configurationHints)
216
+ collector.addConfigurationHint(hint);
220
217
  }
221
- if (isShowConfigHints) {
222
- const unusedIgnoredWorkspaces = chief.getUnusedIgnoredWorkspaces();
223
- for (const identifier of unusedIgnoredWorkspaces) {
224
- collector.addConfigurationHint({ type: 'ignoreWorkspaces', identifier });
225
- }
218
+ const unusedIgnoredWorkspaces = chief.getUnusedIgnoredWorkspaces();
219
+ for (const identifier of unusedIgnoredWorkspaces) {
220
+ collector.addConfigurationHint({ type: 'ignoreWorkspaces', identifier });
226
221
  }
227
222
  };
228
223
  await analyzeGraph();
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import { debugLogArray, debugLogObject } from './util/debug.js';
12
12
  import { getGitIgnoredHandler } from './util/glob-core.js';
13
13
  import { getWatchHandler } from './util/watch.js';
14
14
  export const main = async (unresolvedConfiguration) => {
15
- const { cacheLocation, cwd, excludedIssueTypes, fixTypes, gitignore, includedIssueTypes, isCache, isDebug, isDependenciesShorthand, isExportsShorthand, isFilesShorthand, isFix, isFormat, isDisableConfigHints, isIncludeEntryExports, isIncludeLibs, isIsolateWorkspaces, isProduction, isRemoveFiles, isShowProgress, isStrict, isWatch, tags, tsConfigFile, workspace, } = unresolvedConfiguration;
15
+ const { cacheLocation, cwd, excludedIssueTypes, fixTypes, gitignore, includedIssueTypes, isCache, isDebug, isDependenciesShorthand, isExportsShorthand, isFilesShorthand, isFix, isFormat, isIncludeEntryExports, isIncludeLibs, isIsolateWorkspaces, isProduction, isRemoveFiles, isShowProgress, isStrict, isWatch, tags, tsConfigFile, workspace, } = unresolvedConfiguration;
16
16
  debugLogObject('*', 'Unresolved configuration (from CLI arguments)', unresolvedConfiguration);
17
17
  const chief = new ConfigurationChief({ cwd, isProduction, isStrict, isIncludeEntryExports, workspace });
18
18
  const deputy = new DependencyDeputy({ isProduction, isStrict });
@@ -73,14 +73,12 @@ export const main = async (unresolvedConfiguration) => {
73
73
  fixer,
74
74
  graph,
75
75
  isFix,
76
- isDisableConfigHints,
77
76
  isIncludeLibs,
78
77
  isProduction,
79
78
  report,
80
79
  streamer,
81
80
  tags: finalTags,
82
81
  unreferencedFiles,
83
- workspace,
84
82
  });
85
83
  const { issues, counters, tagHints, configurationHints } = collector.getIssues();
86
84
  if (isWatch) {
@@ -611,7 +611,7 @@ export declare const Plugins: {
611
611
  title: string;
612
612
  enablers: RegExp[];
613
613
  isEnabled: import("../types/config.js").IsPluginEnabled;
614
- entry: string[];
614
+ production: string[];
615
615
  };
616
616
  'simple-git-hooks': {
617
617
  title: string;
@@ -712,6 +712,16 @@ export declare const Plugins: {
712
712
  };
713
713
  };
714
714
  };
715
+ tsdown: {
716
+ title: string;
717
+ enablers: string[];
718
+ isEnabled: import("../types/config.js").IsPluginEnabled;
719
+ config: string[];
720
+ resolveConfig: import("../types/config.js").ResolveConfig<import("./tsdown/types.js").TsdownConfig>;
721
+ args: {
722
+ config: boolean;
723
+ };
724
+ };
715
725
  tsup: {
716
726
  title: string;
717
727
  enablers: string[];
@@ -87,6 +87,7 @@ import { default as syncpack } from './syncpack/index.js';
87
87
  import { default as tailwind } from './tailwind/index.js';
88
88
  import { default as travis } from './travis/index.js';
89
89
  import { default as tsNode } from './ts-node/index.js';
90
+ import { default as tsdown } from './tsdown/index.js';
90
91
  import { default as tsup } from './tsup/index.js';
91
92
  import { default as tsx } from './tsx/index.js';
92
93
  import { default as typedoc } from './typedoc/index.js';
@@ -195,6 +196,7 @@ export const Plugins = {
195
196
  tailwind,
196
197
  travis,
197
198
  'ts-node': tsNode,
199
+ tsdown,
198
200
  tsup,
199
201
  tsx,
200
202
  typedoc,
@@ -3,6 +3,6 @@ declare const _default: {
3
3
  title: string;
4
4
  enablers: RegExp[];
5
5
  isEnabled: IsPluginEnabled;
6
- entry: string[];
6
+ production: string[];
7
7
  };
8
8
  export default _default;
@@ -2,10 +2,10 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Sentry';
3
3
  const enablers = [/^@sentry\//];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const entry = ['sentry.{client,server,edge}.config.{js,ts}'];
5
+ const production = ['sentry.{client,server,edge}.config.{js,ts}'];
6
6
  export default {
7
7
  title,
8
8
  enablers,
9
9
  isEnabled,
10
- entry,
10
+ production,
11
11
  };
@@ -5,14 +5,27 @@ const title = 'Stylelint';
5
5
  const enablers = ['stylelint'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['package.json', ...toCosmiconfig('stylelint')];
8
- const resolve = (config) => {
9
- const extend = config.extends ?? [];
10
- const plugins = config.plugins?.flatMap(plugin => (typeof plugin === 'string' ? [plugin] : [])) ?? [];
11
- const customSyntax = typeof config.customSyntax === 'string' ? [config.customSyntax] : [];
12
- const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(resolve) : [];
13
- return [...[extend, plugins, customSyntax].flat().map(toDeferResolve), ...overrideConfigs];
8
+ const resolveConfig = async (config, options) => {
9
+ const inputs = [];
10
+ const extend = Array.isArray(config.extends) ? config.extends : config.extends ? [config.extends] : [];
11
+ for (const id of extend) {
12
+ if (typeof id === 'string')
13
+ inputs.push(toDeferResolve(id));
14
+ else
15
+ for (const x of await resolveConfig(id, options))
16
+ inputs.push(x);
17
+ }
18
+ for (const plugin of config.plugins ?? [])
19
+ if (typeof plugin === 'string')
20
+ inputs.push(toDeferResolve(plugin));
21
+ if (typeof config.customSyntax === 'string')
22
+ inputs.push(toDeferResolve(config.customSyntax));
23
+ for (const override of config.overrides ?? []) {
24
+ for (const input of await resolveConfig(override, options))
25
+ inputs.push(input);
26
+ }
27
+ return inputs;
14
28
  };
15
- const resolveConfig = config => resolve(config);
16
29
  export default {
17
30
  title,
18
31
  enablers,
@@ -1,8 +1,9 @@
1
- export type BaseStyleLintConfig = {
2
- customSyntax?: unknown;
1
+ interface BaseStyleLintConfig {
2
+ customSyntax?: string;
3
3
  extends?: string | string[];
4
- plugins?: unknown[];
5
- };
6
- export type StyleLintConfig = BaseStyleLintConfig & {
7
- overrides: BaseStyleLintConfig[];
8
- };
4
+ plugins?: (string | BaseStyleLintConfig)[];
5
+ }
6
+ export interface StyleLintConfig extends BaseStyleLintConfig {
7
+ overrides?: BaseStyleLintConfig[];
8
+ }
9
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
+ import type { TsdownConfig } from './types.js';
3
+ declare const _default: {
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<TsdownConfig>;
9
+ args: {
10
+ config: boolean;
11
+ };
12
+ };
13
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { toProductionEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
+ const title = 'tsdown';
4
+ const enablers = ['tsdown'];
5
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
+ const config = ['tsdown.config.{ts,mts,cts,js,mjs,cjs,json}', 'package.json'];
7
+ const resolveConfig = async (config) => {
8
+ if (typeof config === 'function')
9
+ config = await config({});
10
+ const entryPatterns = [config]
11
+ .flat()
12
+ .flatMap(config => {
13
+ if (!config.entry)
14
+ return [];
15
+ if (Array.isArray(config.entry))
16
+ return config.entry;
17
+ return Object.values(config.entry);
18
+ })
19
+ .map(id => toProductionEntry(id, { allowIncludeExports: true }));
20
+ return entryPatterns;
21
+ };
22
+ const args = {
23
+ config: true,
24
+ };
25
+ export default {
26
+ title,
27
+ enablers,
28
+ isEnabled,
29
+ config,
30
+ resolveConfig,
31
+ args,
32
+ };
@@ -0,0 +1,7 @@
1
+ type Entry = string[] | Record<string, string>;
2
+ type Options = {
3
+ entry?: Entry;
4
+ };
5
+ type MaybePromise<T> = T | Promise<T>;
6
+ export type TsdownConfig = Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>);
7
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -5,7 +5,7 @@ export declare const plain: (text: string) => string;
5
5
  export declare const dim: import("picocolors/types.js").Formatter;
6
6
  export declare const getIssueTypeTitle: (reportType: keyof typeof ISSUE_TYPE_TITLE) => string;
7
7
  export declare const getColoredTitle: (title: string, count: number) => string;
8
- export declare const getDimmedTitle: (title: string) => string;
8
+ export declare const getDimmedTitle: (title: string, count: number) => string;
9
9
  type LogIssueLine = {
10
10
  owner?: string;
11
11
  filePath: string;
@@ -8,7 +8,7 @@ export const dim = picocolors.gray;
8
8
  const bright = picocolors.whiteBright;
9
9
  export const getIssueTypeTitle = (reportType) => ISSUE_TYPE_TITLE[reportType];
10
10
  export const getColoredTitle = (title, count) => `${picocolors.yellowBright(picocolors.underline(title))} (${count})`;
11
- export const getDimmedTitle = (title) => `${picocolors.yellow(picocolors.underline(`${title}`))}`;
11
+ export const getDimmedTitle = (title, count) => `${picocolors.yellow(`${picocolors.underline(title)} (${count})`)}`;
12
12
  export const getIssueLine = ({ owner, filePath, symbols, parentSymbol, severity }) => {
13
13
  const symbol = symbols ? `: ${symbols.map(s => s.symbol).join(', ')}` : '';
14
14
  const parent = parentSymbol ? ` (${parentSymbol})` : '';
@@ -1190,6 +1190,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1190
1190
  entry?: string | string[] | undefined;
1191
1191
  project?: string | string[] | undefined;
1192
1192
  }>]>>;
1193
+ tsdown: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1194
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1195
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1196
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1197
+ }, "strip", z.ZodTypeAny, {
1198
+ config?: string | string[] | undefined;
1199
+ entry?: string | string[] | undefined;
1200
+ project?: string | string[] | undefined;
1201
+ }, {
1202
+ config?: string | string[] | undefined;
1203
+ entry?: string | string[] | undefined;
1204
+ project?: string | string[] | undefined;
1205
+ }>]>>;
1193
1206
  tsup: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1194
1207
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1195
1208
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1872,6 +1885,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1872
1885
  entry?: string | string[] | undefined;
1873
1886
  project?: string | string[] | undefined;
1874
1887
  } | undefined;
1888
+ tsdown?: string | boolean | string[] | {
1889
+ config?: string | string[] | undefined;
1890
+ entry?: string | string[] | undefined;
1891
+ project?: string | string[] | undefined;
1892
+ } | undefined;
1875
1893
  tsup?: string | boolean | string[] | {
1876
1894
  config?: string | string[] | undefined;
1877
1895
  entry?: string | string[] | undefined;
@@ -2417,6 +2435,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
2417
2435
  entry?: string | string[] | undefined;
2418
2436
  project?: string | string[] | undefined;
2419
2437
  } | undefined;
2438
+ tsdown?: string | boolean | string[] | {
2439
+ config?: string | string[] | undefined;
2440
+ entry?: string | string[] | undefined;
2441
+ project?: string | string[] | undefined;
2442
+ } | undefined;
2420
2443
  tsup?: string | boolean | string[] | {
2421
2444
  config?: string | string[] | undefined;
2422
2445
  entry?: string | string[] | undefined;
@@ -3673,6 +3696,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
3673
3696
  entry?: string | string[] | undefined;
3674
3697
  project?: string | string[] | undefined;
3675
3698
  }>]>>;
3699
+ tsdown: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3700
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3701
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3702
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3703
+ }, "strip", z.ZodTypeAny, {
3704
+ config?: string | string[] | undefined;
3705
+ entry?: string | string[] | undefined;
3706
+ project?: string | string[] | undefined;
3707
+ }, {
3708
+ config?: string | string[] | undefined;
3709
+ entry?: string | string[] | undefined;
3710
+ project?: string | string[] | undefined;
3711
+ }>]>>;
3676
3712
  tsup: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3677
3713
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3678
3714
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -4358,6 +4394,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4358
4394
  entry?: string | string[] | undefined;
4359
4395
  project?: string | string[] | undefined;
4360
4396
  } | undefined;
4397
+ tsdown?: string | boolean | string[] | {
4398
+ config?: string | string[] | undefined;
4399
+ entry?: string | string[] | undefined;
4400
+ project?: string | string[] | undefined;
4401
+ } | undefined;
4361
4402
  tsup?: string | boolean | string[] | {
4362
4403
  config?: string | string[] | undefined;
4363
4404
  entry?: string | string[] | undefined;
@@ -4911,6 +4952,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4911
4952
  entry?: string | string[] | undefined;
4912
4953
  project?: string | string[] | undefined;
4913
4954
  } | undefined;
4955
+ tsdown?: string | boolean | string[] | {
4956
+ config?: string | string[] | undefined;
4957
+ entry?: string | string[] | undefined;
4958
+ project?: string | string[] | undefined;
4959
+ } | undefined;
4914
4960
  tsup?: string | boolean | string[] | {
4915
4961
  config?: string | string[] | undefined;
4916
4962
  entry?: string | string[] | undefined;
@@ -5460,6 +5506,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
5460
5506
  entry?: string | string[] | undefined;
5461
5507
  project?: string | string[] | undefined;
5462
5508
  } | undefined;
5509
+ tsdown?: string | boolean | string[] | {
5510
+ config?: string | string[] | undefined;
5511
+ entry?: string | string[] | undefined;
5512
+ project?: string | string[] | undefined;
5513
+ } | undefined;
5463
5514
  tsup?: string | boolean | string[] | {
5464
5515
  config?: string | string[] | undefined;
5465
5516
  entry?: string | string[] | undefined;
@@ -6013,6 +6064,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
6013
6064
  entry?: string | string[] | undefined;
6014
6065
  project?: string | string[] | undefined;
6015
6066
  } | undefined;
6067
+ tsdown?: string | boolean | string[] | {
6068
+ config?: string | string[] | undefined;
6069
+ entry?: string | string[] | undefined;
6070
+ project?: string | string[] | undefined;
6071
+ } | undefined;
6016
6072
  tsup?: string | boolean | string[] | {
6017
6073
  config?: string | string[] | undefined;
6018
6074
  entry?: string | string[] | undefined;
@@ -1171,6 +1171,19 @@ export declare const pluginsSchema: z.ZodObject<{
1171
1171
  entry?: string | string[] | undefined;
1172
1172
  project?: string | string[] | undefined;
1173
1173
  }>]>;
1174
+ tsdown: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1175
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1176
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1177
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1178
+ }, "strip", z.ZodTypeAny, {
1179
+ config?: string | string[] | undefined;
1180
+ entry?: string | string[] | undefined;
1181
+ project?: string | string[] | undefined;
1182
+ }, {
1183
+ config?: string | string[] | undefined;
1184
+ entry?: string | string[] | undefined;
1185
+ project?: string | string[] | undefined;
1186
+ }>]>;
1174
1187
  tsup: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1175
1188
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1176
1189
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1851,6 +1864,11 @@ export declare const pluginsSchema: z.ZodObject<{
1851
1864
  entry?: string | string[] | undefined;
1852
1865
  project?: string | string[] | undefined;
1853
1866
  };
1867
+ tsdown: string | boolean | string[] | {
1868
+ config?: string | string[] | undefined;
1869
+ entry?: string | string[] | undefined;
1870
+ project?: string | string[] | undefined;
1871
+ };
1854
1872
  tsup: string | boolean | string[] | {
1855
1873
  config?: string | string[] | undefined;
1856
1874
  entry?: string | string[] | undefined;
@@ -2387,6 +2405,11 @@ export declare const pluginsSchema: z.ZodObject<{
2387
2405
  entry?: string | string[] | undefined;
2388
2406
  project?: string | string[] | undefined;
2389
2407
  };
2408
+ tsdown: string | boolean | string[] | {
2409
+ config?: string | string[] | undefined;
2410
+ entry?: string | string[] | undefined;
2411
+ project?: string | string[] | undefined;
2412
+ };
2390
2413
  tsup: string | boolean | string[] | {
2391
2414
  config?: string | string[] | undefined;
2392
2415
  entry?: string | string[] | undefined;
@@ -99,6 +99,7 @@ export const pluginsSchema = z.object({
99
99
  tailwind: pluginSchema,
100
100
  travis: pluginSchema,
101
101
  'ts-node': pluginSchema,
102
+ tsdown: pluginSchema,
102
103
  tsup: pluginSchema,
103
104
  tsx: pluginSchema,
104
105
  typedoc: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
- export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
1
+ export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
+ export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
@@ -88,6 +88,7 @@ export const pluginNames = [
88
88
  'tailwind',
89
89
  'travis',
90
90
  'ts-node',
91
+ 'tsdown',
91
92
  'tsup',
92
93
  'tsx',
93
94
  'typedoc',
@@ -12,7 +12,6 @@ export interface CommandLineOptions {
12
12
  isFilesShorthand: boolean;
13
13
  isFix: boolean;
14
14
  isFormat: boolean;
15
- isDisableConfigHints: boolean;
16
15
  isIncludeEntryExports: boolean;
17
16
  isIncludeLibs: boolean;
18
17
  isIsolateWorkspaces: boolean;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.58.0";
1
+ export declare const version = "5.59.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.58.0';
1
+ export const version = '5.59.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.58.0",
3
+ "version": "5.59.0",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {
package/schema.json CHANGED
@@ -651,6 +651,10 @@
651
651
  "title": "ts-node plugin configuration (https://knip.dev/reference/plugins/ts-node)",
652
652
  "$ref": "#/definitions/plugin"
653
653
  },
654
+ "tsdown": {
655
+ "title": "tsdown plugin configuration (https://knip.dev/reference/plugins/tsdown)",
656
+ "$ref": "#/definitions/plugin"
657
+ },
654
658
  "tsup": {
655
659
  "title": "tsup plugin configuration (https://knip.dev/reference/plugins/tsup)",
656
660
  "$ref": "#/definitions/plugin"