-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknip.plugin.ts
More file actions
29 lines (27 loc) · 818 Bytes
/
knip.plugin.ts
File metadata and controls
29 lines (27 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import path from 'node:path';
import type { PluginConfig } from '@code-pushup/models';
import { KNIP_AUDITS, KNIP_GROUPS, KNIP_PLUGIN_SLUG } from './constants.js';
import { RunnerOptions, createRunnerFunction } from './runner/index.js';
export type PluginOptions = RunnerOptions;
export function knipPlugin(options: PluginOptions = {}): PluginConfig {
const {
outputFile = path.join(
'.code-pushup',
KNIP_PLUGIN_SLUG,
`knip-report-${Date.now()}.json`,
),
...runnerOptions
} = options;
return {
slug: KNIP_PLUGIN_SLUG,
title: 'Knip',
icon: 'folder-javascript',
description: 'A plugin to track dependencies and duplicates',
runner: createRunnerFunction({
...runnerOptions,
outputFile,
}),
audits: KNIP_AUDITS,
groups: KNIP_GROUPS,
};
}