knip 5.63.0 → 5.63.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/CacheConsultant.d.ts +3 -9
- package/dist/CacheConsultant.js +5 -5
- package/dist/ConfigurationChief.d.ts +585 -38
- package/dist/ConfigurationChief.js +33 -122
- package/dist/ConsoleStreamer.d.ts +2 -3
- package/dist/ConsoleStreamer.js +2 -2
- package/dist/DependencyDeputy.d.ts +2 -6
- package/dist/IssueCollector.d.ts +4 -12
- package/dist/IssueCollector.js +9 -9
- package/dist/IssueFixer.d.ts +3 -14
- package/dist/IssueFixer.js +11 -21
- package/dist/PrincipalFactory.d.ts +3 -2
- package/dist/PrincipalFactory.js +11 -11
- package/dist/ProjectPrincipal.d.ts +4 -3
- package/dist/ProjectPrincipal.js +8 -8
- package/dist/WorkspaceWorker.d.ts +4 -9
- package/dist/WorkspaceWorker.js +8 -12
- package/dist/binaries/bash-parser.js +1 -1
- package/dist/binaries/fallback.js +1 -1
- package/dist/binaries/package-manager/pnpm.js +6 -1
- package/dist/cli.js +43 -61
- package/dist/compilers/index.d.ts +14 -4
- package/dist/graph/analyze.d.ts +3 -8
- package/dist/graph/analyze.js +24 -27
- package/dist/graph/build.d.ts +3 -17
- package/dist/graph/build.js +42 -39
- package/dist/index.d.ts +3 -7
- package/dist/index.js +22 -62
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/nuxt/index.js +4 -3
- package/dist/plugins/nuxt/types.d.ts +3 -2
- package/dist/plugins/pnpm/index.d.ts +7 -0
- package/dist/plugins/pnpm/index.js +8 -0
- package/dist/plugins/rsbuild/index.js +23 -6
- package/dist/plugins/rsbuild/types.d.ts +3 -0
- package/dist/plugins.js +3 -2
- package/dist/reporters/codeclimate.d.ts +1 -1
- package/dist/reporters/codeclimate.js +10 -10
- package/dist/reporters/codeowners.d.ts +1 -1
- package/dist/reporters/codeowners.js +5 -5
- package/dist/reporters/compact.d.ts +1 -1
- package/dist/reporters/compact.js +7 -7
- package/dist/reporters/disclosure.d.ts +1 -1
- package/dist/reporters/disclosure.js +2 -2
- package/dist/reporters/index.d.ts +6 -6
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/json.js +3 -3
- package/dist/reporters/markdown.d.ts +1 -1
- package/dist/reporters/markdown.js +4 -4
- package/dist/reporters/symbols.js +1 -1
- package/dist/reporters/util/configuration-hints.d.ts +1 -1
- package/dist/reporters/util/configuration-hints.js +6 -7
- package/dist/reporters/util/util.d.ts +2 -2
- package/dist/reporters/util/util.js +4 -4
- package/dist/reporters/watch.d.ts +3 -4
- package/dist/reporters/watch.js +5 -5
- package/dist/schema/configuration.d.ts +64 -8
- package/dist/schema/plugins.d.ts +23 -0
- package/dist/schema/plugins.js +1 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +1 -0
- package/dist/types/config.d.ts +4 -10
- package/dist/types/issues.d.ts +1 -2
- package/dist/types/{cli.d.ts → options.d.ts} +2 -2
- package/dist/types/package-json.d.ts +1 -0
- package/dist/types/project.d.ts +1 -7
- package/dist/typescript/get-imports-and-exports.d.ts +2 -2
- package/dist/typescript/get-imports-and-exports.js +9 -10
- package/dist/util/Performance.js +16 -6
- package/dist/util/cli-arguments.d.ts +1 -2
- package/dist/util/cli-arguments.js +3 -13
- package/dist/util/create-options.d.ts +1219 -0
- package/dist/util/create-options.js +112 -0
- package/dist/util/debug.js +3 -4
- package/dist/util/errors.d.ts +1 -1
- package/dist/util/file-entry-cache.js +3 -3
- package/dist/util/get-included-issue-types.d.ts +9 -13
- package/dist/util/get-included-issue-types.js +10 -16
- package/dist/util/get-referenced-inputs.js +1 -1
- package/dist/util/input.d.ts +1 -1
- package/dist/util/input.js +1 -1
- package/dist/util/is-identifier-referenced.d.ts +1 -1
- package/dist/util/is-identifier-referenced.js +2 -2
- package/dist/util/load-config.d.ts +1 -0
- package/dist/util/load-config.js +24 -0
- package/dist/util/path.d.ts +4 -4
- package/dist/util/path.js +5 -7
- package/dist/util/require.js +1 -2
- package/dist/util/tag.d.ts +1 -1
- package/dist/util/to-source-path.d.ts +1 -1
- package/dist/util/to-source-path.js +5 -5
- package/dist/util/trace.d.ts +6 -6
- package/dist/util/trace.js +18 -22
- package/dist/util/watch.d.ts +2 -5
- package/dist/util/watch.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/schema.json +4 -0
- package/dist/util/unwrap-function.d.ts +0 -1
- package/dist/util/unwrap-function.js +0 -13
- /package/dist/types/{cli.js → options.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { toRelative } from '../util/path.js';
|
|
2
2
|
import { getColoredTitle, getIssueLine, getIssueTypeTitle } from './util/util.js';
|
|
3
|
-
const logIssueSet = (issues) => {
|
|
3
|
+
const logIssueSet = (issues, cwd) => {
|
|
4
4
|
for (const filePath of issues.sort())
|
|
5
|
-
console.log(toRelative(filePath));
|
|
5
|
+
console.log(toRelative(filePath, cwd));
|
|
6
6
|
};
|
|
7
|
-
const logIssueRecord = (issues) => {
|
|
7
|
+
const logIssueRecord = (issues, cwd) => {
|
|
8
8
|
const sortedByFilePath = issues.sort((a, b) => (a.filePath > b.filePath ? 1 : -1));
|
|
9
9
|
for (const issue of sortedByFilePath)
|
|
10
|
-
console.log(getIssueLine(issue));
|
|
10
|
+
console.log(getIssueLine(issue, cwd));
|
|
11
11
|
};
|
|
12
|
-
export default ({ report, issues, isShowProgress }) => {
|
|
12
|
+
export default ({ report, issues, isShowProgress, cwd }) => {
|
|
13
13
|
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
14
14
|
let totalIssues = 0;
|
|
15
15
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
@@ -27,10 +27,10 @@ export default ({ report, issues, isShowProgress }) => {
|
|
|
27
27
|
if (issuesForType.length > 0) {
|
|
28
28
|
title && console.log(getColoredTitle(title, issuesForType.length));
|
|
29
29
|
if (isSet) {
|
|
30
|
-
logIssueSet(Array.from(issues[reportType]));
|
|
30
|
+
logIssueSet(Array.from(issues[reportType]), cwd);
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
logIssueRecord(issuesForType);
|
|
33
|
+
logIssueRecord(issuesForType, cwd);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
totalIssues = totalIssues + issuesForType.length;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getIssueTypeTitle, getTableForType } from './util/util.js';
|
|
2
|
-
export default ({ report, issues }) => {
|
|
2
|
+
export default ({ report, issues, cwd }) => {
|
|
3
3
|
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
4
4
|
for (let [reportType, isReportType] of Object.entries(report)) {
|
|
5
5
|
if (reportType === 'files')
|
|
@@ -9,7 +9,7 @@ export default ({ report, issues }) => {
|
|
|
9
9
|
const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
|
|
10
10
|
if (issuesForType.length > 0) {
|
|
11
11
|
console.log(`<details>\n${title ? `<summary>${title} (${issuesForType.length})</summary>\n` : ''}\n\`\`\``);
|
|
12
|
-
console.log(getTableForType(issuesForType, { isUseColors: false }).toString());
|
|
12
|
+
console.log(getTableForType(issuesForType, cwd, { isUseColors: false }).toString());
|
|
13
13
|
console.log('```\n\n</details>\n');
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
symbols: (options: 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
|
-
disclosure: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
6
|
-
codeclimate: ({ report, issues }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
7
|
-
json: ({ report, issues, options }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
8
|
-
markdown: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
3
|
+
compact: ({ report, issues, isShowProgress, cwd }: import("../index.js").ReporterOptions) => void;
|
|
4
|
+
codeowners: ({ report, issues, isShowProgress, options, cwd }: import("../index.js").ReporterOptions) => void;
|
|
5
|
+
disclosure: ({ report, issues, cwd }: import("../index.js").ReporterOptions) => void;
|
|
6
|
+
codeclimate: ({ report, issues, cwd }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
7
|
+
json: ({ report, issues, options, cwd }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
8
|
+
markdown: ({ report, issues, cwd }: import("../index.js").ReporterOptions) => void;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
package/dist/reporters/json.d.ts
CHANGED
package/dist/reporters/json.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createOwnershipEngine } from '../util/codeowners.js';
|
|
|
2
2
|
import { isFile } from '../util/fs.js';
|
|
3
3
|
import { relative, resolve } from '../util/path.js';
|
|
4
4
|
import { convert } from './util/util.js';
|
|
5
|
-
export default async ({ report, issues, options }) => {
|
|
5
|
+
export default async ({ report, issues, options, cwd }) => {
|
|
6
6
|
let opts = {};
|
|
7
7
|
try {
|
|
8
8
|
opts = options ? JSON.parse(options) : opts;
|
|
@@ -15,7 +15,7 @@ export default async ({ report, issues, options }) => {
|
|
|
15
15
|
const findOwners = isFile(codeownersFilePath) && createOwnershipEngine(codeownersFilePath);
|
|
16
16
|
const flatten = (issues) => Object.values(issues).flatMap(Object.values);
|
|
17
17
|
const initRow = (filePath) => {
|
|
18
|
-
const file = relative(filePath);
|
|
18
|
+
const file = relative(cwd, filePath);
|
|
19
19
|
const row = {
|
|
20
20
|
file,
|
|
21
21
|
...(findOwners && { owners: findOwners(file).map(name => ({ name })) }),
|
|
@@ -66,7 +66,7 @@ export default async ({ report, issues, options }) => {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
const output = JSON.stringify({
|
|
69
|
-
files: Array.from(issues.files).map(filePath => relative(filePath)),
|
|
69
|
+
files: Array.from(issues.files).map(filePath => relative(cwd, filePath)),
|
|
70
70
|
issues: Object.values(json),
|
|
71
71
|
});
|
|
72
72
|
process.stdout._handle?.setBlocking?.(true);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { relative, toRelative } from '../util/path.js';
|
|
2
2
|
import { getIssueTypeTitle } from './util/util.js';
|
|
3
|
-
export default ({ report, issues }) => {
|
|
3
|
+
export default ({ report, issues, cwd }) => {
|
|
4
4
|
console.log('# Knip report\n');
|
|
5
5
|
const getFilePath = (issue) => {
|
|
6
6
|
if (!(issue.line && issue.col))
|
|
7
|
-
return relative(issue.filePath);
|
|
8
|
-
return `${relative(issue.filePath)}:${issue.line}:${issue.col}`;
|
|
7
|
+
return relative(cwd, issue.filePath);
|
|
8
|
+
return `${relative(cwd, issue.filePath)}:${issue.line}:${issue.col}`;
|
|
9
9
|
};
|
|
10
10
|
const sortLongestSymbol = (a, b) => b.symbol.length - a.symbol.length;
|
|
11
11
|
const sortLongestFilePath = (a, b) => getFilePath(b).length - getFilePath(a).length;
|
|
@@ -20,7 +20,7 @@ export default ({ report, issues }) => {
|
|
|
20
20
|
console.log(`## ${title} (${issuesForType.length})\n`);
|
|
21
21
|
if (isSet) {
|
|
22
22
|
for (const issue of issuesForType.sort()) {
|
|
23
|
-
console.log(`* ${toRelative(issue)}`);
|
|
23
|
+
console.log(`* ${toRelative(issue, cwd)}`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
@@ -12,7 +12,7 @@ export default (options) => {
|
|
|
12
12
|
const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
|
|
13
13
|
if (issuesForType.length > 0) {
|
|
14
14
|
title && console.log(getColoredTitle(title, issuesForType.length));
|
|
15
|
-
console.log(getTableForType(issuesForType).toString());
|
|
15
|
+
console.log(getTableForType(issuesForType, options.cwd).toString());
|
|
16
16
|
totalIssues = totalIssues + issuesForType.length;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ReporterOptions } from '../../types/issues.js';
|
|
2
|
-
export declare const printConfigurationHints: ({ counters, issues, tagHints, configurationHints, isTreatConfigHintsAsErrors,
|
|
2
|
+
export declare const printConfigurationHints: ({ cwd, counters, issues, tagHints, configurationHints, isTreatConfigHintsAsErrors, includedWorkspaceDirs, configFilePath, }: ReporterOptions) => void;
|
|
@@ -14,7 +14,7 @@ const getTableForHints = (hints) => {
|
|
|
14
14
|
table.row();
|
|
15
15
|
table.cell('identifier', hint.identifier.toString());
|
|
16
16
|
table.cell('workspace', getWorkspaceName(hint));
|
|
17
|
-
table.cell('filePath', hint.filePath
|
|
17
|
+
table.cell('filePath', hint.filePath);
|
|
18
18
|
table.cell('description', dim(hint.message));
|
|
19
19
|
}
|
|
20
20
|
return table;
|
|
@@ -52,10 +52,9 @@ const hintTypesOrder = [
|
|
|
52
52
|
['entry-empty', 'project-empty', 'entry-redundant', 'project-redundant'],
|
|
53
53
|
['package-entry'],
|
|
54
54
|
];
|
|
55
|
-
export const printConfigurationHints = ({ counters, issues, tagHints, configurationHints, isTreatConfigHintsAsErrors,
|
|
55
|
+
export const printConfigurationHints = ({ cwd, counters, issues, tagHints, configurationHints, isTreatConfigHintsAsErrors, includedWorkspaceDirs, configFilePath, }) => {
|
|
56
56
|
if (counters.files > 20) {
|
|
57
|
-
const workspaces =
|
|
58
|
-
.map(workspace => workspace.dir)
|
|
57
|
+
const workspaces = includedWorkspaceDirs
|
|
59
58
|
.sort(byPathDepth)
|
|
60
59
|
.reverse()
|
|
61
60
|
.map(dir => ({ dir, size: 0 }));
|
|
@@ -66,7 +65,7 @@ export const printConfigurationHints = ({ counters, issues, tagHints, configurat
|
|
|
66
65
|
}
|
|
67
66
|
const hlWorkspaces = workspaces.sort((a, b) => b.size - a.size).filter(ws => ws.size > 1);
|
|
68
67
|
for (const { dir, size } of hlWorkspaces) {
|
|
69
|
-
const identifier = toRelative(dir) || '.';
|
|
68
|
+
const identifier = toRelative(dir, cwd) || '.';
|
|
70
69
|
configurationHints.add({ type: 'workspace-unconfigured', workspaceName: identifier, identifier, size });
|
|
71
70
|
}
|
|
72
71
|
}
|
|
@@ -81,7 +80,7 @@ export const printConfigurationHints = ({ counters, issues, tagHints, configurat
|
|
|
81
80
|
const rows = hintTypesOrder.flatMap(hintTypes => hintTypes.flatMap(hintType => {
|
|
82
81
|
const hints = hintsByType.get(hintType) ?? [];
|
|
83
82
|
return hints.map(hint => {
|
|
84
|
-
hint.filePath
|
|
83
|
+
hint.filePath = relative(cwd, hint.filePath ?? configFilePath ?? '');
|
|
85
84
|
const hintPrinter = hintPrinters.get(hint.type);
|
|
86
85
|
const message = hintPrinter ? hintPrinter.print({ ...hint, configFilePath }) : '';
|
|
87
86
|
return { ...hint, message };
|
|
@@ -93,7 +92,7 @@ export const printConfigurationHints = ({ counters, issues, tagHints, configurat
|
|
|
93
92
|
console.log(getColoredTitle('Tag issues', tagHints.size));
|
|
94
93
|
for (const hint of tagHints) {
|
|
95
94
|
const { filePath, identifier, tagName } = hint;
|
|
96
|
-
const message = `Unused tag in ${toRelative(filePath)}:`;
|
|
95
|
+
const message = `Unused tag in ${toRelative(filePath, cwd)}:`;
|
|
97
96
|
console.warn(dim(message), `${identifier} → ${tagName}`);
|
|
98
97
|
}
|
|
99
98
|
}
|
|
@@ -13,14 +13,14 @@ type LogIssueLine = {
|
|
|
13
13
|
parentSymbol?: string;
|
|
14
14
|
severity?: IssueSeverity;
|
|
15
15
|
};
|
|
16
|
-
export declare const getIssueLine: ({ owner, filePath, symbols, parentSymbol, severity }: LogIssueLine) => string;
|
|
16
|
+
export declare const getIssueLine: ({ owner, filePath, symbols, parentSymbol, severity }: LogIssueLine, cwd: string) => string;
|
|
17
17
|
export declare const convert: (issue: Issue | IssueSymbol) => {
|
|
18
18
|
name: string;
|
|
19
19
|
line: number | undefined;
|
|
20
20
|
col: number | undefined;
|
|
21
21
|
pos: number | undefined;
|
|
22
22
|
};
|
|
23
|
-
export declare const getTableForType: (issues: Issue[], options?: {
|
|
23
|
+
export declare const getTableForType: (issues: Issue[], cwd: string, options?: {
|
|
24
24
|
isUseColors?: boolean;
|
|
25
25
|
}) => Table;
|
|
26
26
|
export {};
|
|
@@ -10,11 +10,11 @@ const yellow = picocolors.yellow;
|
|
|
10
10
|
export const getIssueTypeTitle = (reportType) => ISSUE_TYPE_TITLE[reportType];
|
|
11
11
|
export const getColoredTitle = (title, count) => `${picocolors.yellowBright(picocolors.underline(title))} (${count})`;
|
|
12
12
|
export const getDimmedTitle = (title, count) => `${yellow(`${picocolors.underline(title)} (${count})`)}`;
|
|
13
|
-
export const getIssueLine = ({ owner, filePath, symbols, parentSymbol, severity }) => {
|
|
13
|
+
export const getIssueLine = ({ owner, filePath, symbols, parentSymbol, severity }, cwd) => {
|
|
14
14
|
const symbol = symbols ? `: ${symbols.map(s => s.symbol).join(', ')}` : '';
|
|
15
15
|
const parent = parentSymbol ? ` (${parentSymbol})` : '';
|
|
16
16
|
const print = severity === 'warn' ? dim : plain;
|
|
17
|
-
return `${owner ? `${picocolors.cyan(owner)} ` : ''}${print(`${relative(filePath)}${symbol}${parent}`)}`;
|
|
17
|
+
return `${owner ? `${picocolors.cyan(owner)} ` : ''}${print(`${relative(cwd, filePath)}${symbol}${parent}`)}`;
|
|
18
18
|
};
|
|
19
19
|
export const convert = (issue) => ({
|
|
20
20
|
name: issue.symbol,
|
|
@@ -39,7 +39,7 @@ const highlightSymbol = (issue) => (_) => {
|
|
|
39
39
|
}
|
|
40
40
|
return issue.symbol;
|
|
41
41
|
};
|
|
42
|
-
export const getTableForType = (issues, options = { isUseColors: true }) => {
|
|
42
|
+
export const getTableForType = (issues, cwd, options = { isUseColors: true }) => {
|
|
43
43
|
const table = new Table({ truncateStart: ['filePath'], noTruncate: ['symbolType'] });
|
|
44
44
|
for (const issue of issues.sort(sortByPos)) {
|
|
45
45
|
table.row();
|
|
@@ -49,7 +49,7 @@ export const getTableForType = (issues, options = { isUseColors: true }) => {
|
|
|
49
49
|
table.cell('parentSymbol', issue.parentSymbol && print(issue.parentSymbol));
|
|
50
50
|
table.cell('symbolType', issue.symbolType && issue.symbolType !== SymbolType.UNKNOWN && print(issue.symbolType));
|
|
51
51
|
const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
|
|
52
|
-
const cell = issue.type === 'files' ? '' : `${relative(issue.filePath)}${pos}`;
|
|
52
|
+
const cell = issue.type === 'files' ? '' : `${relative(cwd, issue.filePath)}${pos}`;
|
|
53
53
|
table.cell('filePath', print(cell));
|
|
54
54
|
table.cell('fixed', issue.isFixed && print('(removed)'));
|
|
55
55
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { ConsoleStreamer } from '../ConsoleStreamer.js';
|
|
2
|
-
import type { Issues
|
|
2
|
+
import type { Issues } from '../types/issues.js';
|
|
3
|
+
import type { MainOptions } from '../util/create-options.js';
|
|
3
4
|
interface WatchReporter {
|
|
4
|
-
report: Report;
|
|
5
5
|
issues: Issues;
|
|
6
6
|
streamer: ConsoleStreamer;
|
|
7
7
|
startTime?: number;
|
|
8
8
|
size: number;
|
|
9
|
-
isDebug: boolean;
|
|
10
9
|
}
|
|
11
|
-
declare const _default: (
|
|
10
|
+
declare const _default: (options: MainOptions, { issues, streamer, startTime, size }: WatchReporter) => void;
|
|
12
11
|
export default _default;
|
package/dist/reporters/watch.js
CHANGED
|
@@ -2,11 +2,11 @@ import picocolors from 'picocolors';
|
|
|
2
2
|
import { perfObserver } from '../util/Performance.js';
|
|
3
3
|
import { prettyMilliseconds } from '../util/string.js';
|
|
4
4
|
import { getIssueTypeTitle, getTableForType } from './util/util.js';
|
|
5
|
-
export default ({
|
|
6
|
-
const reportMultipleGroups = Object.values(
|
|
5
|
+
export default (options, { issues, streamer, startTime, size }) => {
|
|
6
|
+
const reportMultipleGroups = Object.values(options.includedIssueTypes).filter(Boolean).length > 1;
|
|
7
7
|
let totalIssues = 0;
|
|
8
8
|
const lines = [];
|
|
9
|
-
for (let [reportType, isReportType] of Object.entries(
|
|
9
|
+
for (let [reportType, isReportType] of Object.entries(options.includedIssueTypes)) {
|
|
10
10
|
if (reportType === 'files')
|
|
11
11
|
reportType = '_files';
|
|
12
12
|
if (isReportType) {
|
|
@@ -16,7 +16,7 @@ export default ({ report, issues, streamer, startTime, size, isDebug }) => {
|
|
|
16
16
|
if (title) {
|
|
17
17
|
lines.push(`${picocolors.yellowBright(picocolors.underline(title))} (${issuesForType.length})`);
|
|
18
18
|
}
|
|
19
|
-
lines.push(...getTableForType(issuesForType).toRows());
|
|
19
|
+
lines.push(...getTableForType(issuesForType, options.cwd).toRows());
|
|
20
20
|
}
|
|
21
21
|
totalIssues = totalIssues + issuesForType.length;
|
|
22
22
|
}
|
|
@@ -27,7 +27,7 @@ export default ({ report, issues, streamer, startTime, size, isDebug }) => {
|
|
|
27
27
|
const messages = totalIssues === 0
|
|
28
28
|
? ['✂️ Excellent, Knip found no issues.', '', picocolors.gray(summary)]
|
|
29
29
|
: [...lines, '', picocolors.gray(summary)];
|
|
30
|
-
if (isDebug)
|
|
30
|
+
if (options.isDebug)
|
|
31
31
|
console.log(messages.join('\n'));
|
|
32
32
|
else
|
|
33
33
|
streamer.cast(messages);
|
|
@@ -852,6 +852,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
852
852
|
entry?: string | string[] | undefined;
|
|
853
853
|
project?: string | string[] | undefined;
|
|
854
854
|
}>]>>;
|
|
855
|
+
pnpm: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
856
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
857
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
858
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
859
|
+
}, "strip", z.ZodTypeAny, {
|
|
860
|
+
config?: string | string[] | undefined;
|
|
861
|
+
entry?: string | string[] | undefined;
|
|
862
|
+
project?: string | string[] | undefined;
|
|
863
|
+
}, {
|
|
864
|
+
config?: string | string[] | undefined;
|
|
865
|
+
entry?: string | string[] | undefined;
|
|
866
|
+
project?: string | string[] | undefined;
|
|
867
|
+
}>]>>;
|
|
855
868
|
postcss: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
856
869
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
857
870
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -1794,6 +1807,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
1794
1807
|
entry?: string | string[] | undefined;
|
|
1795
1808
|
project?: string | string[] | undefined;
|
|
1796
1809
|
} | undefined;
|
|
1810
|
+
pnpm?: string | boolean | string[] | {
|
|
1811
|
+
config?: string | string[] | undefined;
|
|
1812
|
+
entry?: string | string[] | undefined;
|
|
1813
|
+
project?: string | string[] | undefined;
|
|
1814
|
+
} | undefined;
|
|
1797
1815
|
postcss?: string | boolean | string[] | {
|
|
1798
1816
|
config?: string | string[] | undefined;
|
|
1799
1817
|
entry?: string | string[] | undefined;
|
|
@@ -2359,6 +2377,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
2359
2377
|
entry?: string | string[] | undefined;
|
|
2360
2378
|
project?: string | string[] | undefined;
|
|
2361
2379
|
} | undefined;
|
|
2380
|
+
pnpm?: string | boolean | string[] | {
|
|
2381
|
+
config?: string | string[] | undefined;
|
|
2382
|
+
entry?: string | string[] | undefined;
|
|
2383
|
+
project?: string | string[] | undefined;
|
|
2384
|
+
} | undefined;
|
|
2362
2385
|
postcss?: string | boolean | string[] | {
|
|
2363
2386
|
config?: string | string[] | undefined;
|
|
2364
2387
|
entry?: string | string[] | undefined;
|
|
@@ -3427,6 +3450,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
3427
3450
|
entry?: string | string[] | undefined;
|
|
3428
3451
|
project?: string | string[] | undefined;
|
|
3429
3452
|
}>]>>;
|
|
3453
|
+
pnpm: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
3454
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
3455
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
3456
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
3457
|
+
}, "strip", z.ZodTypeAny, {
|
|
3458
|
+
config?: string | string[] | undefined;
|
|
3459
|
+
entry?: string | string[] | undefined;
|
|
3460
|
+
project?: string | string[] | undefined;
|
|
3461
|
+
}, {
|
|
3462
|
+
config?: string | string[] | undefined;
|
|
3463
|
+
entry?: string | string[] | undefined;
|
|
3464
|
+
project?: string | string[] | undefined;
|
|
3465
|
+
}>]>>;
|
|
3430
3466
|
postcss: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
3431
3467
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
3432
3468
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -4052,9 +4088,6 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
4052
4088
|
project?: string | string[] | undefined;
|
|
4053
4089
|
}>]>>;
|
|
4054
4090
|
}, "strict", z.ZodTypeAny, {
|
|
4055
|
-
exclude?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
4056
|
-
tags?: string[] | undefined;
|
|
4057
|
-
include?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
4058
4091
|
node?: string | boolean | string[] | {
|
|
4059
4092
|
config?: string | string[] | undefined;
|
|
4060
4093
|
entry?: string | string[] | undefined;
|
|
@@ -4372,6 +4405,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
4372
4405
|
entry?: string | string[] | undefined;
|
|
4373
4406
|
project?: string | string[] | undefined;
|
|
4374
4407
|
} | undefined;
|
|
4408
|
+
pnpm?: string | boolean | string[] | {
|
|
4409
|
+
config?: string | string[] | undefined;
|
|
4410
|
+
entry?: string | string[] | undefined;
|
|
4411
|
+
project?: string | string[] | undefined;
|
|
4412
|
+
} | undefined;
|
|
4375
4413
|
postcss?: string | boolean | string[] | {
|
|
4376
4414
|
config?: string | string[] | undefined;
|
|
4377
4415
|
entry?: string | string[] | undefined;
|
|
@@ -4612,8 +4650,9 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
4612
4650
|
entry?: string | string[] | undefined;
|
|
4613
4651
|
project?: string | string[] | undefined;
|
|
4614
4652
|
} | undefined;
|
|
4653
|
+
exclude?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
4615
4654
|
$schema?: string | undefined;
|
|
4616
|
-
rules?: Partial<Record<"
|
|
4655
|
+
rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
|
|
4617
4656
|
paths?: Record<string, string[]> | undefined;
|
|
4618
4657
|
ignore?: string | string[] | undefined;
|
|
4619
4658
|
ignoreBinaries?: (string | RegExp)[] | undefined;
|
|
@@ -4626,7 +4665,9 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
4626
4665
|
compilers?: Record<string, true | ((args_0: string, args_1: string, ...args: unknown[]) => string) | ((args_0: string, args_1: string, ...args: unknown[]) => Promise<string>)> | undefined;
|
|
4627
4666
|
syncCompilers?: Record<string, true | ((args_0: string, args_1: string, ...args: unknown[]) => string)> | undefined;
|
|
4628
4667
|
asyncCompilers?: Record<string, (args_0: string, args_1: string, ...args: unknown[]) => Promise<string>> | undefined;
|
|
4668
|
+
tags?: string[] | undefined;
|
|
4629
4669
|
treatConfigHintsAsErrors?: boolean | undefined;
|
|
4670
|
+
include?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
4630
4671
|
workspaces?: Record<string, {
|
|
4631
4672
|
node?: string | boolean | string[] | {
|
|
4632
4673
|
config?: string | string[] | undefined;
|
|
@@ -4945,6 +4986,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
4945
4986
|
entry?: string | string[] | undefined;
|
|
4946
4987
|
project?: string | string[] | undefined;
|
|
4947
4988
|
} | undefined;
|
|
4989
|
+
pnpm?: string | boolean | string[] | {
|
|
4990
|
+
config?: string | string[] | undefined;
|
|
4991
|
+
entry?: string | string[] | undefined;
|
|
4992
|
+
project?: string | string[] | undefined;
|
|
4993
|
+
} | undefined;
|
|
4948
4994
|
postcss?: string | boolean | string[] | {
|
|
4949
4995
|
config?: string | string[] | undefined;
|
|
4950
4996
|
entry?: string | string[] | undefined;
|
|
@@ -5194,9 +5240,6 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
5194
5240
|
includeEntryExports?: boolean | undefined;
|
|
5195
5241
|
}> | undefined;
|
|
5196
5242
|
}, {
|
|
5197
|
-
exclude?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
5198
|
-
tags?: string[] | undefined;
|
|
5199
|
-
include?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
5200
5243
|
node?: string | boolean | string[] | {
|
|
5201
5244
|
config?: string | string[] | undefined;
|
|
5202
5245
|
entry?: string | string[] | undefined;
|
|
@@ -5514,6 +5557,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
5514
5557
|
entry?: string | string[] | undefined;
|
|
5515
5558
|
project?: string | string[] | undefined;
|
|
5516
5559
|
} | undefined;
|
|
5560
|
+
pnpm?: string | boolean | string[] | {
|
|
5561
|
+
config?: string | string[] | undefined;
|
|
5562
|
+
entry?: string | string[] | undefined;
|
|
5563
|
+
project?: string | string[] | undefined;
|
|
5564
|
+
} | undefined;
|
|
5517
5565
|
postcss?: string | boolean | string[] | {
|
|
5518
5566
|
config?: string | string[] | undefined;
|
|
5519
5567
|
entry?: string | string[] | undefined;
|
|
@@ -5754,8 +5802,9 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
5754
5802
|
entry?: string | string[] | undefined;
|
|
5755
5803
|
project?: string | string[] | undefined;
|
|
5756
5804
|
} | undefined;
|
|
5805
|
+
exclude?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
5757
5806
|
$schema?: string | undefined;
|
|
5758
|
-
rules?: Partial<Record<"
|
|
5807
|
+
rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
|
|
5759
5808
|
paths?: Record<string, string[]> | undefined;
|
|
5760
5809
|
ignore?: string | string[] | undefined;
|
|
5761
5810
|
ignoreBinaries?: (string | RegExp)[] | undefined;
|
|
@@ -5768,7 +5817,9 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
5768
5817
|
compilers?: Record<string, true | ((args_0: string, args_1: string, ...args: unknown[]) => string) | ((args_0: string, args_1: string, ...args: unknown[]) => Promise<string>)> | undefined;
|
|
5769
5818
|
syncCompilers?: Record<string, true | ((args_0: string, args_1: string, ...args: unknown[]) => string)> | undefined;
|
|
5770
5819
|
asyncCompilers?: Record<string, (args_0: string, args_1: string, ...args: unknown[]) => Promise<string>> | undefined;
|
|
5820
|
+
tags?: string[] | undefined;
|
|
5771
5821
|
treatConfigHintsAsErrors?: boolean | undefined;
|
|
5822
|
+
include?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
|
|
5772
5823
|
workspaces?: Record<string, {
|
|
5773
5824
|
node?: string | boolean | string[] | {
|
|
5774
5825
|
config?: string | string[] | undefined;
|
|
@@ -6087,6 +6138,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
|
|
|
6087
6138
|
entry?: string | string[] | undefined;
|
|
6088
6139
|
project?: string | string[] | undefined;
|
|
6089
6140
|
} | undefined;
|
|
6141
|
+
pnpm?: string | boolean | string[] | {
|
|
6142
|
+
config?: string | string[] | undefined;
|
|
6143
|
+
entry?: string | string[] | undefined;
|
|
6144
|
+
project?: string | string[] | undefined;
|
|
6145
|
+
} | undefined;
|
|
6090
6146
|
postcss?: string | boolean | string[] | {
|
|
6091
6147
|
config?: string | string[] | undefined;
|
|
6092
6148
|
entry?: string | string[] | undefined;
|
package/dist/schema/plugins.d.ts
CHANGED
|
@@ -833,6 +833,19 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
833
833
|
entry?: string | string[] | undefined;
|
|
834
834
|
project?: string | string[] | undefined;
|
|
835
835
|
}>]>;
|
|
836
|
+
pnpm: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
837
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
838
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
839
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
840
|
+
}, "strip", z.ZodTypeAny, {
|
|
841
|
+
config?: string | string[] | undefined;
|
|
842
|
+
entry?: string | string[] | undefined;
|
|
843
|
+
project?: string | string[] | undefined;
|
|
844
|
+
}, {
|
|
845
|
+
config?: string | string[] | undefined;
|
|
846
|
+
entry?: string | string[] | undefined;
|
|
847
|
+
project?: string | string[] | undefined;
|
|
848
|
+
}>]>;
|
|
836
849
|
postcss: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
837
850
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
838
851
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -1773,6 +1786,11 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
1773
1786
|
entry?: string | string[] | undefined;
|
|
1774
1787
|
project?: string | string[] | undefined;
|
|
1775
1788
|
};
|
|
1789
|
+
pnpm: string | boolean | string[] | {
|
|
1790
|
+
config?: string | string[] | undefined;
|
|
1791
|
+
entry?: string | string[] | undefined;
|
|
1792
|
+
project?: string | string[] | undefined;
|
|
1793
|
+
};
|
|
1776
1794
|
postcss: string | boolean | string[] | {
|
|
1777
1795
|
config?: string | string[] | undefined;
|
|
1778
1796
|
entry?: string | string[] | undefined;
|
|
@@ -2329,6 +2347,11 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
2329
2347
|
entry?: string | string[] | undefined;
|
|
2330
2348
|
project?: string | string[] | undefined;
|
|
2331
2349
|
};
|
|
2350
|
+
pnpm: string | boolean | string[] | {
|
|
2351
|
+
config?: string | string[] | undefined;
|
|
2352
|
+
entry?: string | string[] | undefined;
|
|
2353
|
+
project?: string | string[] | undefined;
|
|
2354
|
+
};
|
|
2332
2355
|
postcss: string | boolean | string[] | {
|
|
2333
2356
|
config?: string | string[] | undefined;
|
|
2334
2357
|
entry?: string | string[] | undefined;
|
package/dist/schema/plugins.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'biome' | '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' | 'node-modules-inspector' | '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' | 'rslib' | '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", "biome", "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", "node-modules-inspector", "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", "rslib", "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"];
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'biome' | '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' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rslib' | '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", "biome", "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", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "pnpm", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rslib", "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"];
|
package/dist/types/config.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type { pluginSchema } from '../schema/plugins.js';
|
|
|
6
6
|
import type { Input } from '../util/input.js';
|
|
7
7
|
import type { PluginName } from './PluginNames.js';
|
|
8
8
|
import type { Args } from './args.js';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { SymbolType } from './issues.js';
|
|
10
|
+
import type { Tags } from './options.js';
|
|
11
11
|
import type { PackageJson } from './package-json.js';
|
|
12
12
|
export interface GetInputsFromScriptsOptions extends BaseOptions {
|
|
13
13
|
knownBinsOnly?: boolean;
|
|
@@ -24,32 +24,26 @@ export type RawConfiguration = z.infer<typeof knipConfigurationSchema>;
|
|
|
24
24
|
export type RawPluginConfiguration = z.infer<typeof pluginSchema>;
|
|
25
25
|
export type IgnorePatterns = (string | RegExp)[];
|
|
26
26
|
type IgnorableExport = Exclude<SymbolType, SymbolType.UNKNOWN>;
|
|
27
|
-
type IgnoreExportsUsedInFile = boolean | Partial<Record<IgnorableExport, boolean>>;
|
|
27
|
+
export type IgnoreExportsUsedInFile = boolean | Partial<Record<IgnorableExport, boolean>>;
|
|
28
28
|
export type GetImportsAndExportsOptions = {
|
|
29
29
|
skipTypeOnly: boolean;
|
|
30
|
-
skipExports: boolean;
|
|
31
30
|
isFixExports: boolean;
|
|
32
31
|
isFixTypes: boolean;
|
|
33
32
|
isReportClassMembers: boolean;
|
|
34
|
-
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
35
33
|
tags: Tags;
|
|
36
34
|
};
|
|
37
35
|
export interface Configuration {
|
|
38
|
-
rules: Rules;
|
|
39
|
-
include: IssueType[];
|
|
40
|
-
exclude: IssueType[];
|
|
41
36
|
ignore: NormalizedGlob;
|
|
42
37
|
ignoreBinaries: IgnorePatterns;
|
|
43
38
|
ignoreDependencies: IgnorePatterns;
|
|
44
39
|
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
45
40
|
ignoreMembers: IgnorePatterns;
|
|
41
|
+
ignoreUnresolved: IgnorePatterns;
|
|
46
42
|
ignoreWorkspaces: string[];
|
|
47
43
|
isIncludeEntryExports: boolean;
|
|
48
|
-
isTreatConfigHintsAsErrors: boolean;
|
|
49
44
|
syncCompilers: SyncCompilers;
|
|
50
45
|
asyncCompilers: AsyncCompilers;
|
|
51
46
|
rootPluginConfigs: Partial<PluginsConfiguration>;
|
|
52
|
-
tags: string[];
|
|
53
47
|
}
|
|
54
48
|
type NormalizedGlob = string[];
|
|
55
49
|
export type EnsuredPluginConfiguration = {
|
package/dist/types/issues.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Workspace } from '../ConfigurationChief.js';
|
|
2
1
|
export declare enum SymbolType {
|
|
3
2
|
VARIABLE = "variable",
|
|
4
3
|
TYPE = "type",
|
|
@@ -68,7 +67,7 @@ export type ReporterOptions = {
|
|
|
68
67
|
isShowProgress: boolean;
|
|
69
68
|
options: string;
|
|
70
69
|
preprocessorOptions: string;
|
|
71
|
-
|
|
70
|
+
includedWorkspaceDirs: string[];
|
|
72
71
|
configFilePath?: string;
|
|
73
72
|
};
|
|
74
73
|
export type Reporter = (options: ReporterOptions) => void;
|