knip 2.17.2 → 2.17.3
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/README.md +1 -1
- package/dist/cli.js +1 -0
- package/dist/constants.js +2 -0
- package/dist/reporters/codeowners.d.ts +1 -1
- package/dist/reporters/codeowners.js +2 -2
- package/dist/reporters/compact.d.ts +1 -1
- package/dist/reporters/compact.js +2 -2
- package/dist/reporters/index.d.ts +3 -3
- package/dist/reporters/symbols.d.ts +1 -1
- package/dist/reporters/symbols.js +2 -2
- package/dist/types/issues.d.ts +1 -0
- package/dist/util/cli-arguments.d.ts +1 -1
- package/dist/util/cli-arguments.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -143,7 +143,7 @@ Using workspaces in a monorepo? Please see [workspaces][1] for more details abou
|
|
|
143
143
|
--dependencies Shortcut for --include dependencies,unlisted,unresolved
|
|
144
144
|
--exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates
|
|
145
145
|
--include-entry-exports Include entry files when reporting unused exports
|
|
146
|
-
-n, --no-progress Don't show dynamic progress updates
|
|
146
|
+
-n, --no-progress Don't show dynamic progress updates (this is automatically enabled in CI environments)
|
|
147
147
|
--reporter Select reporter: symbols, compact, codeowners, json (default: symbols)
|
|
148
148
|
--reporter-options Pass extra options to the reporter (as JSON string, see example)
|
|
149
149
|
--no-config-hints Suppress configuration hints
|
package/dist/cli.js
CHANGED
package/dist/constants.js
CHANGED
|
@@ -11,7 +11,7 @@ const logIssueRecord = (issues) => {
|
|
|
11
11
|
const sortedByFilePath = issues.sort((a, b) => (a.owner < b.owner ? -1 : 1));
|
|
12
12
|
sortedByFilePath.forEach(({ filePath, symbols, owner, parentSymbol }) => logIssueLine({ owner, filePath, symbols, parentSymbol }));
|
|
13
13
|
};
|
|
14
|
-
export default ({ report, issues, options }) => {
|
|
14
|
+
export default ({ report, issues, isShowProgress, options }) => {
|
|
15
15
|
let opts = {};
|
|
16
16
|
try {
|
|
17
17
|
opts = options ? JSON.parse(options) : opts;
|
|
@@ -56,7 +56,7 @@ export default ({ report, issues, options }) => {
|
|
|
56
56
|
totalIssues = totalIssues + issuesForType.length;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
if (totalIssues === 0) {
|
|
59
|
+
if (totalIssues === 0 && isShowProgress) {
|
|
60
60
|
console.log('✂️ Excellent, Knip found no issues.');
|
|
61
61
|
}
|
|
62
62
|
};
|
|
@@ -3,7 +3,7 @@ const logIssueRecord = (issues) => {
|
|
|
3
3
|
const sortedByFilePath = issues.sort((a, b) => (a.filePath > b.filePath ? 1 : -1));
|
|
4
4
|
sortedByFilePath.forEach(logIssueLine);
|
|
5
5
|
};
|
|
6
|
-
export default ({ report, issues }) => {
|
|
6
|
+
export default ({ report, issues, isShowProgress }) => {
|
|
7
7
|
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
8
8
|
let totalIssues = 0;
|
|
9
9
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
@@ -30,7 +30,7 @@ export default ({ report, issues }) => {
|
|
|
30
30
|
totalIssues = totalIssues + issuesForType.length;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
if (totalIssues === 0) {
|
|
33
|
+
if (totalIssues === 0 && isShowProgress) {
|
|
34
34
|
console.log('✂️ Excellent, Knip found no issues.');
|
|
35
35
|
}
|
|
36
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
symbols: ({ report, issues, configurationHints, noConfigHints }: import("../index.js").ReporterOptions) => void;
|
|
3
|
-
compact: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
4
|
-
codeowners: ({ report, issues, options }: import("../index.js").ReporterOptions) => void;
|
|
2
|
+
symbols: ({ report, issues, configurationHints, noConfigHints, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
3
|
+
compact: ({ report, issues, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
4
|
+
codeowners: ({ report, issues, isShowProgress, options }: import("../index.js").ReporterOptions) => void;
|
|
5
5
|
json: ({ report, issues, options }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReporterOptions } from '../types/issues.js';
|
|
2
|
-
declare const _default: ({ report, issues, configurationHints, noConfigHints }: ReporterOptions) => void;
|
|
2
|
+
declare const _default: ({ report, issues, configurationHints, noConfigHints, isShowProgress }: ReporterOptions) => void;
|
|
3
3
|
export default _default;
|
|
@@ -17,7 +17,7 @@ const logIssueRecord = (issues) => {
|
|
|
17
17
|
});
|
|
18
18
|
console.log(table.sort(['filePath', 'parentSymbol', 'symbol']).print().trim());
|
|
19
19
|
};
|
|
20
|
-
export default ({ report, issues, configurationHints, noConfigHints }) => {
|
|
20
|
+
export default ({ report, issues, configurationHints, noConfigHints, isShowProgress }) => {
|
|
21
21
|
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
22
22
|
let totalIssues = 0;
|
|
23
23
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
@@ -48,7 +48,7 @@ export default ({ report, issues, configurationHints, noConfigHints }) => {
|
|
|
48
48
|
console.warn(chalk.grey(`${message}${workspace}:`), identifier);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
if (totalIssues === 0) {
|
|
51
|
+
if (totalIssues === 0 && isShowProgress) {
|
|
52
52
|
console.log('✂️ Excellent, Knip found no issues.');
|
|
53
53
|
}
|
|
54
54
|
};
|
package/dist/types/issues.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --no-gitignore Don't use .gitignore\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,unresolved\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --include-entry-exports Include entry files when reporting unused exports\n -n, --no-progress Don't show dynamic progress updates\n --reporter Select reporter: symbols, compact, codeowners, json (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-config-hints Suppress configuration hints\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n -d, --debug Show debug output\n --debug-file-filter Filter for files in debug output (regex as string)\n --performance Measure count and running time of expensive functions and display stats table\n -h, --help Print this help text\n -V, --version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --debug --debug-file-filter '(specific|particular)-module'\n\nMore documentation and bug reports: https://github.com/webpro/knip";
|
|
1
|
+
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --no-gitignore Don't use .gitignore\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,unresolved\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --include-entry-exports Include entry files when reporting unused exports\n -n, --no-progress Don't show dynamic progress updates (this is automatically enabled in CI environments)\n --reporter Select reporter: symbols, compact, codeowners, json (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-config-hints Suppress configuration hints\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n -d, --debug Show debug output\n --debug-file-filter Filter for files in debug output (regex as string)\n --performance Measure count and running time of expensive functions and display stats table\n -h, --help Print this help text\n -V, --version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --debug --debug-file-filter '(specific|particular)-module'\n\nMore documentation and bug reports: https://github.com/webpro/knip";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
config: string | undefined;
|
|
4
4
|
debug: boolean | undefined;
|
|
@@ -15,7 +15,7 @@ Options:
|
|
|
15
15
|
--dependencies Shortcut for --include dependencies,unlisted,unresolved
|
|
16
16
|
--exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates
|
|
17
17
|
--include-entry-exports Include entry files when reporting unused exports
|
|
18
|
-
-n, --no-progress Don't show dynamic progress updates
|
|
18
|
+
-n, --no-progress Don't show dynamic progress updates (this is automatically enabled in CI environments)
|
|
19
19
|
--reporter Select reporter: symbols, compact, codeowners, json (default: symbols)
|
|
20
20
|
--reporter-options Pass extra options to the reporter (as JSON string, see example)
|
|
21
21
|
--no-config-hints Suppress configuration hints
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.17.
|
|
1
|
+
export declare const version = "2.17.3";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.17.
|
|
1
|
+
export const version = '2.17.3';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.3",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://github.com/webpro/knip",
|
|
6
6
|
"repository": "github:webpro/knip",
|
|
@@ -63,29 +63,29 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@jest/types": "29.6.1",
|
|
65
65
|
"@npmcli/package-json": "4.0.1",
|
|
66
|
-
"@release-it/bumper": "5.
|
|
66
|
+
"@release-it/bumper": "5.1.0",
|
|
67
67
|
"@swc/cli": "0.1.62",
|
|
68
|
-
"@swc/core": "1.3.
|
|
69
|
-
"@types/eslint": "8.44.
|
|
68
|
+
"@swc/core": "1.3.73",
|
|
69
|
+
"@types/eslint": "8.44.1",
|
|
70
70
|
"@types/js-yaml": "4.0.5",
|
|
71
71
|
"@types/micromatch": "4.0.2",
|
|
72
72
|
"@types/minimist": "1.2.2",
|
|
73
|
-
"@types/node": "20.4.
|
|
73
|
+
"@types/node": "20.4.5",
|
|
74
74
|
"@types/npmcli__map-workspaces": "3.0.1",
|
|
75
75
|
"@types/webpack": "5.28.1",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "6.1
|
|
77
|
-
"@typescript-eslint/parser": "6.1
|
|
78
|
-
"c8": "8.0.
|
|
79
|
-
"eslint": "8.
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "6.2.1",
|
|
77
|
+
"@typescript-eslint/parser": "6.2.1",
|
|
78
|
+
"c8": "8.0.1",
|
|
79
|
+
"eslint": "8.46.0",
|
|
80
80
|
"eslint-import-resolver-typescript": "3.5.5",
|
|
81
|
-
"eslint-plugin-import": "2.
|
|
81
|
+
"eslint-plugin-import": "2.28.0",
|
|
82
82
|
"eslint-plugin-n": "16.0.1",
|
|
83
83
|
"prettier": "3.0.0",
|
|
84
84
|
"release-it": "16.1.3",
|
|
85
85
|
"remark-cli": "11.0.0",
|
|
86
86
|
"remark-preset-webpro": "0.0.3",
|
|
87
87
|
"tsx": "3.12.7",
|
|
88
|
-
"type-fest": "4.
|
|
88
|
+
"type-fest": "4.1.0"
|
|
89
89
|
},
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=16.17.0 <17 || >=18.6.0"
|