knip 6.8.0 → 6.9.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.
@@ -1,3 +1,34 @@
1
1
  import type { ReporterOptions } from '../types/issues.ts';
2
+ export interface JSONReportNamedItem {
3
+ name: string;
4
+ }
5
+ export interface JSONReportItem extends JSONReportNamedItem {
6
+ namespace?: string;
7
+ pos?: number;
8
+ line?: number;
9
+ col?: number;
10
+ }
11
+ export type JSONReportEntry = {
12
+ file: string;
13
+ owners?: Array<JSONReportNamedItem>;
14
+ binaries?: Array<JSONReportNamedItem>;
15
+ catalog?: Array<JSONReportItem>;
16
+ dependencies?: Array<JSONReportItem>;
17
+ devDependencies?: Array<JSONReportItem>;
18
+ duplicates?: Array<Array<JSONReportItem>>;
19
+ enumMembers?: Array<JSONReportItem>;
20
+ exports?: Array<JSONReportItem>;
21
+ files?: Array<JSONReportItem>;
22
+ namespaceMembers?: Array<JSONReportItem>;
23
+ nsExports?: Array<JSONReportItem>;
24
+ nsTypes?: Array<JSONReportItem>;
25
+ optionalPeerDependencies?: Array<JSONReportItem>;
26
+ types?: Array<JSONReportItem>;
27
+ unlisted?: Array<JSONReportNamedItem>;
28
+ unresolved?: Array<JSONReportItem>;
29
+ };
30
+ export type JSONReport = {
31
+ issues: Array<JSONReportEntry>;
32
+ };
2
33
  declare const _default: ({ report, issues, options, cwd }: ReporterOptions) => Promise<void>;
3
34
  export default _default;
@@ -53,9 +53,8 @@ export default async ({ report, issues, options, cwd }) => {
53
53
  }
54
54
  }
55
55
  }
56
- const output = JSON.stringify({
57
- issues: Object.values(json),
58
- });
56
+ const jsonReport = { issues: Object.values(json) };
57
+ const output = JSON.stringify(jsonReport);
59
58
  process.stdout._handle?.setBlocking?.(true);
60
59
  process.stdout.write(`${output}\n`);
61
60
  };
package/dist/types.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export type { RawConfigurationOrFn as KnipConfig, RawConfiguration as KnipConfiguration, WorkspaceProjectConfig, } from './types/config.ts';
2
2
  export type { Preprocessor, Reporter, ReporterOptions } from './types/issues.ts';
3
+ export type { JSONReport, JSONReportEntry, JSONReportItem, JSONReportNamedItem } from './reporters/json.ts';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.8.0";
1
+ export declare const version = "6.9.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.8.0';
1
+ export const version = '6.9.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",