knip 5.42.2 → 5.43.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.
@@ -68,6 +68,7 @@ export declare class ConfigurationChief {
68
68
  getIgnores(workspaceName: string): {
69
69
  ignoreBinaries: any[];
70
70
  ignoreDependencies: any[];
71
+ ignoreUnresolved: any[];
71
72
  };
72
73
  getConfigForWorkspace(workspaceName: string, extensions?: string[]): {
73
74
  node?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -312,14 +312,16 @@ export class ConfigurationChief {
312
312
  const workspaceConfig = this.getWorkspaceConfig(workspaceName);
313
313
  const ignoreBinaries = arrayify(workspaceConfig.ignoreBinaries);
314
314
  const ignoreDependencies = arrayify(workspaceConfig.ignoreDependencies);
315
+ const ignoreUnresolved = arrayify(workspaceConfig.ignoreUnresolved);
315
316
  if (workspaceName === ROOT_WORKSPACE_NAME) {
316
- const { ignoreBinaries: rootIgnoreBinaries, ignoreDependencies: rootIgnoreDependencies } = this.rawConfig ?? {};
317
+ const { ignoreBinaries: rootIgnoreBinaries, ignoreDependencies: rootIgnoreDependencies, ignoreUnresolved: rootIgnoreUnresolved, } = this.rawConfig ?? {};
317
318
  return {
318
319
  ignoreBinaries: compact([...ignoreBinaries, ...(rootIgnoreBinaries ?? [])]),
319
320
  ignoreDependencies: compact([...ignoreDependencies, ...(rootIgnoreDependencies ?? [])]),
321
+ ignoreUnresolved: compact([...ignoreUnresolved, ...(rootIgnoreUnresolved ?? [])]),
320
322
  };
321
323
  }
322
- return { ignoreBinaries, ignoreDependencies };
324
+ return { ignoreBinaries, ignoreDependencies, ignoreUnresolved };
323
325
  }
324
326
  getConfigForWorkspace(workspaceName, extensions) {
325
327
  const baseConfig = getDefaultWorkspaceConfig(extensions);
@@ -8,6 +8,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
8
8
  ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
9
9
  ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
10
10
  ignoreMembers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
11
+ ignoreUnresolved: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
11
12
  ignoreExportsUsedInFile: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodUnion<[z.ZodLiteral<"class">, z.ZodLiteral<"enum">, z.ZodLiteral<"function">, z.ZodLiteral<"interface">, z.ZodLiteral<"member">, z.ZodLiteral<"type">]>, z.ZodBoolean>]>>;
12
13
  ignoreWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
14
  includeEntryExports: z.ZodOptional<z.ZodBoolean>;
@@ -26,6 +27,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
26
27
  ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
27
28
  ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
28
29
  ignoreMembers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
30
+ ignoreUnresolved: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
29
31
  includeEntryExports: z.ZodOptional<z.ZodBoolean>;
30
32
  }, {
31
33
  angular: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
@@ -1674,6 +1676,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
1674
1676
  ignoreBinaries?: (string | RegExp)[] | undefined;
1675
1677
  ignoreDependencies?: (string | RegExp)[] | undefined;
1676
1678
  ignoreMembers?: (string | RegExp)[] | undefined;
1679
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
1677
1680
  includeEntryExports?: boolean | undefined;
1678
1681
  }, {
1679
1682
  node?: string | boolean | string[] | {
@@ -2138,6 +2141,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
2138
2141
  ignoreBinaries?: (string | RegExp)[] | undefined;
2139
2142
  ignoreDependencies?: (string | RegExp)[] | undefined;
2140
2143
  ignoreMembers?: (string | RegExp)[] | undefined;
2144
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
2141
2145
  includeEntryExports?: boolean | undefined;
2142
2146
  }>>>;
2143
2147
  }>, {
@@ -3790,6 +3794,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
3790
3794
  ignoreBinaries?: (string | RegExp)[] | undefined;
3791
3795
  ignoreDependencies?: (string | RegExp)[] | undefined;
3792
3796
  ignoreMembers?: (string | RegExp)[] | undefined;
3797
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
3793
3798
  ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
3794
3799
  ignoreWorkspaces?: string[] | undefined;
3795
3800
  includeEntryExports?: boolean | undefined;
@@ -4259,6 +4264,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
4259
4264
  ignoreBinaries?: (string | RegExp)[] | undefined;
4260
4265
  ignoreDependencies?: (string | RegExp)[] | undefined;
4261
4266
  ignoreMembers?: (string | RegExp)[] | undefined;
4267
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
4262
4268
  includeEntryExports?: boolean | undefined;
4263
4269
  }> | undefined;
4264
4270
  }, {
@@ -4727,6 +4733,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
4727
4733
  ignoreBinaries?: (string | RegExp)[] | undefined;
4728
4734
  ignoreDependencies?: (string | RegExp)[] | undefined;
4729
4735
  ignoreMembers?: (string | RegExp)[] | undefined;
4736
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
4730
4737
  ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
4731
4738
  ignoreWorkspaces?: string[] | undefined;
4732
4739
  includeEntryExports?: boolean | undefined;
@@ -5196,6 +5203,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
5196
5203
  ignoreBinaries?: (string | RegExp)[] | undefined;
5197
5204
  ignoreDependencies?: (string | RegExp)[] | undefined;
5198
5205
  ignoreMembers?: (string | RegExp)[] | undefined;
5206
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
5199
5207
  includeEntryExports?: boolean | undefined;
5200
5208
  }> | undefined;
5201
5209
  }>;
@@ -43,6 +43,7 @@ const rootConfigurationSchema = z.object({
43
43
  ignoreBinaries: stringOrRegexSchema.optional(),
44
44
  ignoreDependencies: stringOrRegexSchema.optional(),
45
45
  ignoreMembers: stringOrRegexSchema.optional(),
46
+ ignoreUnresolved: stringOrRegexSchema.optional(),
46
47
  ignoreExportsUsedInFile: ignoreExportsUsedInFileSchema.optional(),
47
48
  ignoreWorkspaces: z.array(z.string()).optional(),
48
49
  includeEntryExports: z.boolean().optional(),
@@ -62,6 +63,7 @@ const baseWorkspaceConfigurationSchema = z.object({
62
63
  ignoreBinaries: stringOrRegexSchema.optional(),
63
64
  ignoreDependencies: stringOrRegexSchema.optional(),
64
65
  ignoreMembers: stringOrRegexSchema.optional(),
66
+ ignoreUnresolved: stringOrRegexSchema.optional(),
65
67
  includeEntryExports: z.boolean().optional(),
66
68
  });
67
69
  const workspaceConfigurationSchema = baseWorkspaceConfigurationSchema.merge(pluginsSchema.partial());
@@ -16,7 +16,7 @@ export declare class DependencyDeputy {
16
16
  installedBinaries: Map<string, InstalledBinaries>;
17
17
  hasTypesIncluded: Map<string, Set<string>>;
18
18
  constructor({ isProduction, isStrict }: Options);
19
- addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreDependencies, ignoreBinaries, }: {
19
+ addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreDependencies, ignoreBinaries, ignoreUnresolved, }: {
20
20
  name: string;
21
21
  cwd: string;
22
22
  dir: string;
@@ -24,6 +24,7 @@ export declare class DependencyDeputy {
24
24
  manifest: PackageJson;
25
25
  ignoreDependencies: (string | RegExp)[];
26
26
  ignoreBinaries: (string | RegExp)[];
27
+ ignoreUnresolved: (string | RegExp)[];
27
28
  }): void;
28
29
  getWorkspaceManifest(workspaceName: string): {
29
30
  workspaceDir: string;
@@ -35,8 +36,10 @@ export declare class DependencyDeputy {
35
36
  allDependencies: DependencySet;
36
37
  ignoreDependencies: (string | RegExp)[];
37
38
  ignoreBinaries: (string | RegExp)[];
39
+ ignoreUnresolved: (string | RegExp)[];
38
40
  usedIgnoreDependencies: Set<string | RegExp>;
39
41
  usedIgnoreBinaries: Set<string | RegExp>;
42
+ usedIgnoreUnresolved: Set<string | RegExp>;
40
43
  } | undefined;
41
44
  getProductionDependencies(workspaceName: string): DependencyArray;
42
45
  getDevDependencies(workspaceName: string): DependencyArray;
@@ -63,6 +66,7 @@ export declare class DependencyDeputy {
63
66
  };
64
67
  handleIgnoredDependencies(issues: Issues, counters: Counters, type: SymbolIssueType): void;
65
68
  handleIgnoredBinaries(issues: Issues, counters: Counters, type: SymbolIssueType): void;
69
+ handleIgnoredUnresolved(issues: Issues, counters: Counters): void;
66
70
  removeIgnoredIssues({ issues, counters }: {
67
71
  issues: Issues;
68
72
  counters: Counters;
@@ -21,7 +21,7 @@ export class DependencyDeputy {
21
21
  this.installedBinaries = new Map();
22
22
  this.hasTypesIncluded = new Map();
23
23
  }
24
- addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreDependencies, ignoreBinaries, }) {
24
+ addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreDependencies, ignoreBinaries, ignoreUnresolved, }) {
25
25
  const dependencies = Object.keys(manifest.dependencies ?? {});
26
26
  const peerDependencies = Object.keys(manifest.peerDependencies ?? {});
27
27
  const optionalDependencies = Object.keys(manifest.optionalDependencies ?? {});
@@ -50,8 +50,10 @@ export class DependencyDeputy {
50
50
  manifestPath,
51
51
  ignoreDependencies: ignoreDependencies.map(toRegexOrString),
52
52
  ignoreBinaries: ignoreBinaries.map(toRegexOrString),
53
+ ignoreUnresolved: ignoreUnresolved.map(toRegexOrString),
53
54
  usedIgnoreDependencies: new Set(),
54
55
  usedIgnoreBinaries: new Set(),
56
+ usedIgnoreUnresolved: new Set(),
55
57
  dependencies,
56
58
  devDependencies,
57
59
  peerDependencies: new Set(peerDependencies),
@@ -284,6 +286,23 @@ export class DependencyDeputy {
284
286
  }
285
287
  }
286
288
  }
289
+ handleIgnoredUnresolved(issues, counters) {
290
+ for (const key in issues.unresolved) {
291
+ const issueSet = issues.unresolved[key];
292
+ for (const issueKey in issueSet) {
293
+ const issue = issueSet[issueKey];
294
+ const manifest = this.getWorkspaceManifest(issue.workspace);
295
+ if (manifest) {
296
+ const ignoreItem = findMatch(manifest.ignoreUnresolved, issue.symbol);
297
+ if (ignoreItem) {
298
+ delete issueSet[issueKey];
299
+ counters.unresolved--;
300
+ manifest.usedIgnoreUnresolved.add(ignoreItem);
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
287
306
  removeIgnoredIssues({ issues, counters }) {
288
307
  this.handleIgnoredDependencies(issues, counters, 'dependencies');
289
308
  this.handleIgnoredDependencies(issues, counters, 'devDependencies');
@@ -291,6 +310,7 @@ export class DependencyDeputy {
291
310
  this.handleIgnoredDependencies(issues, counters, 'unlisted');
292
311
  this.handleIgnoredDependencies(issues, counters, 'unresolved');
293
312
  this.handleIgnoredBinaries(issues, counters, 'binaries');
313
+ this.handleIgnoredUnresolved(issues, counters);
294
314
  }
295
315
  getConfigurationHints() {
296
316
  const configurationHints = new Set();
@@ -305,6 +325,11 @@ export class DependencyDeputy {
305
325
  configurationHints.add({ workspaceName, identifier, type: 'ignoreBinaries' });
306
326
  }
307
327
  }
328
+ for (const identifier of manifest.ignoreUnresolved) {
329
+ if (!manifest.usedIgnoreUnresolved.has(identifier)) {
330
+ configurationHints.add({ workspaceName, identifier, type: 'ignoreUnresolved' });
331
+ }
332
+ }
308
333
  }
309
334
  return configurationHints;
310
335
  }
@@ -171,7 +171,7 @@ export class WorkspaceWorker {
171
171
  const inputsFromManifest = _getInputsFromScripts(Object.values(developmentScripts), baseOptions);
172
172
  const productionInputsFromManifest = _getInputsFromScripts(Object.values(productionScripts), baseOptions);
173
173
  const hasProductionInput = (input) => productionInputsFromManifest.find(d => d.specifier === input.specifier && d.type === input.type);
174
- const getInputsFromScripts = (scripts, options) => _getInputsFromScripts(scripts, { ...baseScriptOptions, ...options });
174
+ const createGetInputsFromScripts = (containingFilePath) => (scripts, options) => _getInputsFromScripts(scripts, { ...baseOptions, ...options, containingFilePath });
175
175
  const inputs = [];
176
176
  const configFiles = new Map();
177
177
  const remainingPlugins = new Set(this.enabledPlugins);
@@ -217,12 +217,13 @@ export class WorkspaceWorker {
217
217
  configFilePath: containingFilePath,
218
218
  configFileDir: cwd,
219
219
  configFileName: '',
220
- getInputsFromScripts,
220
+ getInputsFromScripts: createGetInputsFromScripts(containingFilePath),
221
221
  };
222
222
  const configEntryPaths = [];
223
223
  for (const configFilePath of remainingConfigFilePaths) {
224
224
  const opts = {
225
225
  ...options,
226
+ getInputsFromScripts: createGetInputsFromScripts(configFilePath),
226
227
  configFilePath,
227
228
  configFileDir: dirname(configFilePath),
228
229
  configFileName: basename(configFilePath),
@@ -3,6 +3,8 @@ import { Plugins, pluginArgsMap } from '../plugins.js';
3
3
  import { debugLogObject } from '../util/debug.js';
4
4
  import { toBinary, toDeferResolve } from '../util/input.js';
5
5
  import { extractBinary } from '../util/modules.js';
6
+ import { relative } from '../util/path.js';
7
+ import { truncate } from '../util/string.js';
6
8
  import { resolve as fallbackResolve } from './fallback.js';
7
9
  import PackageManagerResolvers from './package-manager/index.js';
8
10
  import { resolve as resolverFromPlugins } from './plugins.js';
@@ -85,7 +87,8 @@ export const getDependenciesFromScript = (script, options) => {
85
87
  return parsed?.commands ? getDependenciesFromNodes(parsed.commands) : [];
86
88
  }
87
89
  catch (error) {
88
- debugLogObject('*', 'Bash parser error', error);
90
+ const msg = `Warning: failed to parse and ignoring script in ${relative(options.containingFilePath)} (${truncate(script, 30)})`;
91
+ debugLogObject('*', msg, error);
89
92
  return [];
90
93
  }
91
94
  };
@@ -469,6 +469,7 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
469
469
  ignoreBinaries?: (string | RegExp)[] | undefined;
470
470
  ignoreDependencies?: (string | RegExp)[] | undefined;
471
471
  ignoreMembers?: (string | RegExp)[] | undefined;
472
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
472
473
  ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
473
474
  ignoreWorkspaces?: string[] | undefined;
474
475
  includeEntryExports?: boolean | undefined;
@@ -936,6 +937,7 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
936
937
  ignoreBinaries?: (string | RegExp)[] | undefined;
937
938
  ignoreDependencies?: (string | RegExp)[] | undefined;
938
939
  ignoreMembers?: (string | RegExp)[] | undefined;
940
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
939
941
  includeEntryExports?: boolean | undefined;
940
942
  }> | undefined;
941
943
  };
package/dist/index.js CHANGED
@@ -68,8 +68,7 @@ export const main = async (unresolvedConfiguration) => {
68
68
  const manifest = chief.getManifestForWorkspace(name);
69
69
  if (!manifest)
70
70
  continue;
71
- const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);
72
- deputy.addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreBinaries, ignoreDependencies });
71
+ deputy.addWorkspace({ name, cwd, dir, manifestPath, manifest, ...chief.getIgnores(name) });
73
72
  }
74
73
  for (const workspace of workspaces) {
75
74
  const { name, dir, ancestors, pkgName } = workspace;
@@ -252,18 +251,18 @@ export const main = async (unresolvedConfiguration) => {
252
251
  if (scripts && scripts.size > 0) {
253
252
  const dependencies = deputy.getDependencies(workspace.name);
254
253
  const manifestScriptNames = new Set(Object.keys(chief.getManifestForWorkspace(workspace.name)?.scripts ?? {}));
255
- const rootCwd = cwd;
254
+ const dir = dirname(filePath);
256
255
  const options = {
257
- cwd: dirname(filePath),
258
- rootCwd,
256
+ cwd: dir,
257
+ rootCwd: cwd,
259
258
  containingFilePath: filePath,
260
259
  dependencies,
261
260
  manifestScriptNames,
262
261
  };
263
262
  const inputs = _getInputsFromScripts(scripts, options);
264
263
  for (const input of inputs) {
265
- input.containingFilePath = filePath;
266
- input.dir = cwd;
264
+ input.containingFilePath ??= filePath;
265
+ input.dir ??= dir;
267
266
  const specifierFilePath = getReferencedInternalFilePath(input, workspace);
268
267
  if (specifierFilePath)
269
268
  analyzeSourceFile(specifierFilePath, principal);
@@ -35,7 +35,7 @@ const resolveConfig = async (config) => {
35
35
  return [...inputs].map(toDeferResolve);
36
36
  };
37
37
  const note = `False positives for platform-specific unused files?
38
- Override the entry patterns as shown below to match platforms and extensions.`;
38
+ Override the default \`entry\` patterns to match platforms and extensions.`;
39
39
  export const docs = { note, production };
40
40
  export default {
41
41
  title,
@@ -29,7 +29,8 @@ const resolveConfig = async (localConfig) => {
29
29
  ? [`@storybook/builder-${builder}`, `@storybook/manager-${builder}`]
30
30
  : [builder]
31
31
  : [];
32
- const frameworks = localConfig.framework?.name ? [localConfig.framework.name] : [];
32
+ const framework = typeof localConfig.framework === 'string' ? localConfig.framework : localConfig.framework?.name;
33
+ const frameworks = framework ? [framework] : [];
33
34
  return [
34
35
  ...addons.map(toDeferResolve),
35
36
  ...builderPackages.map(id => toDependency(id)),
@@ -13,7 +13,7 @@ export type StorybookConfig = {
13
13
  name?: string;
14
14
  };
15
15
  };
16
- framework?: {
16
+ framework?: string | {
17
17
  name?: string;
18
18
  };
19
19
  };
@@ -30,5 +30,6 @@ const builtInReporters = [
30
30
  export const getExternalReporters = (reporters) => reporters
31
31
  ? [reporters]
32
32
  .flat()
33
+ .map(reporter => (Array.isArray(reporter) ? reporter[0] : reporter))
33
34
  .filter((reporter) => typeof reporter === 'string' && !builtInReporters.includes(reporter))
34
35
  : [];
@@ -8,7 +8,7 @@ interface VitestConfig {
8
8
  root?: string;
9
9
  environment?: string;
10
10
  globalSetup?: string | string[];
11
- reporters?: (string | unknown)[];
11
+ reporters?: (string | [string, unknown] | unknown)[];
12
12
  setupFiles?: string | string[];
13
13
  };
14
14
  }
@@ -2,11 +2,11 @@ import EasyTable from 'easy-table';
2
2
  import picocolors from 'picocolors';
3
3
  import { ROOT_WORKSPACE_NAME } from '../constants.js';
4
4
  import { relative, toRelative } from '../util/path.js';
5
+ import { truncate } from '../util/string.js';
5
6
  import { getTitle, identity, logTitle } from './util.js';
6
7
  const dim = picocolors.gray;
7
8
  const bright = picocolors.whiteBright;
8
9
  const TRUNCATE_WIDTH = 40;
9
- const truncate = (text) => (text.length > TRUNCATE_WIDTH ? `${text.slice(0, TRUNCATE_WIDTH - 3)}...` : text);
10
10
  const truncateStart = (text, width) => (text.length > width ? `...${text.slice(-(width - 3))}` : text);
11
11
  const sortByPos = (a, b) => {
12
12
  const [f, r, c] = a.filePath.split(':');
@@ -28,7 +28,8 @@ const logIssueRecord = (issues) => {
28
28
  const table = new EasyTable();
29
29
  for (const issue of issues) {
30
30
  const print = issue.isFixed || issue.severity === 'warn' ? dim : identity;
31
- table.cell('symbol', print(issue.symbols ? truncate(issue.symbols.map(s => s.symbol).join(', ')) : hl(issue)));
31
+ const symbols = issue.symbols;
32
+ table.cell('symbol', print(symbols ? truncate(symbols.map(s => s.symbol).join(', '), TRUNCATE_WIDTH) : hl(issue)));
32
33
  issue.parentSymbol && table.cell('parentSymbol', print(issue.parentSymbol));
33
34
  issue.symbolType && table.cell('symbolType', print(issue.symbolType));
34
35
  const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
@@ -72,7 +72,7 @@ export type IssueSeverity = 'error' | 'warn' | 'off';
72
72
  export type Rules = Record<IssueType, IssueSeverity>;
73
73
  export type ConfigurationHints = Set<ConfigurationHint>;
74
74
  export type ConfigurationHint = {
75
- type: 'ignoreBinaries' | 'ignoreDependencies' | 'ignoreWorkspaces';
75
+ type: 'ignoreBinaries' | 'ignoreDependencies' | 'ignoreUnresolved' | 'ignoreWorkspaces';
76
76
  identifier: string | RegExp;
77
77
  workspaceName?: string;
78
78
  };
@@ -10,8 +10,10 @@ type WorkspaceManifest = {
10
10
  allDependencies: DependencySet;
11
11
  ignoreDependencies: (string | RegExp)[];
12
12
  ignoreBinaries: (string | RegExp)[];
13
+ ignoreUnresolved: (string | RegExp)[];
13
14
  usedIgnoreDependencies: Set<string | RegExp>;
14
15
  usedIgnoreBinaries: Set<string | RegExp>;
16
+ usedIgnoreUnresolved: Set<string | RegExp>;
15
17
  };
16
18
  export type WorkspaceManifests = Map<string, WorkspaceManifest>;
17
19
  export type HostDependencies = Map<string, Array<{
@@ -0,0 +1 @@
1
+ export declare const truncate: (text: string, width: number) => string;
@@ -0,0 +1 @@
1
+ export const truncate = (text, width) => text.length > width ? `${text.slice(0, width - 3)}...` : text;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.42.2";
1
+ export declare const version = "5.43.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.42.2';
1
+ export const version = '5.43.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.42.2",
3
+ "version": "5.43.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {