|
1 | 1 | import path from 'node:path'; |
2 | | -import type {PluginConfig} from '@code-pushup/models'; |
3 | | -import {KNIP_AUDITS, KNIP_GROUPS, KNIP_PLUGIN_SLUG} from './constants.js'; |
4 | | -import { |
5 | | - RunnerOptions, |
6 | | - createRunnerFunction, |
7 | | -} from './runner/index.js'; |
| 2 | +import type { PluginConfig } from '@code-pushup/models'; |
| 3 | +import { KNIP_AUDITS, KNIP_GROUPS, KNIP_PLUGIN_SLUG } from './constants.js'; |
| 4 | +import { RunnerOptions, createRunnerFunction } from './runner/index.js'; |
8 | 5 |
|
9 | 6 | export type PluginOptions = RunnerOptions; |
10 | 7 |
|
11 | 8 | export function knipPlugin(options: PluginOptions = {}): PluginConfig { |
12 | | - const { |
13 | | - outputFile = path.join( |
14 | | - '.code-pushup', |
15 | | - KNIP_PLUGIN_SLUG, |
16 | | - `knip-report-${Date.now()}.json`, |
17 | | - ), |
18 | | - ...runnerOptions |
19 | | - } = options; |
20 | | - return { |
21 | | - slug: KNIP_PLUGIN_SLUG, |
22 | | - title: 'Knip', |
23 | | - icon: 'folder-javascript', |
24 | | - description: 'A plugin to track dependencies and duplicates', |
25 | | - runner: createRunnerFunction({ |
26 | | - ...runnerOptions, |
27 | | - outputFile, |
28 | | - }), |
29 | | - audits: KNIP_AUDITS, |
30 | | - groups: KNIP_GROUPS, |
31 | | - }; |
| 9 | + const { |
| 10 | + outputFile = path.join( |
| 11 | + '.code-pushup', |
| 12 | + KNIP_PLUGIN_SLUG, |
| 13 | + `knip-report-${Date.now()}.json`, |
| 14 | + ), |
| 15 | + ...runnerOptions |
| 16 | + } = options; |
| 17 | + return { |
| 18 | + slug: KNIP_PLUGIN_SLUG, |
| 19 | + title: 'Knip', |
| 20 | + icon: 'folder-javascript', |
| 21 | + description: 'A plugin to track dependencies and duplicates', |
| 22 | + runner: createRunnerFunction({ |
| 23 | + ...runnerOptions, |
| 24 | + outputFile, |
| 25 | + }), |
| 26 | + audits: KNIP_AUDITS, |
| 27 | + groups: KNIP_GROUPS, |
| 28 | + }; |
32 | 29 | } |
0 commit comments