|
1 | 1 | import { IssueType as KnipIssueType } from 'knip/dist/types/issues'; |
2 | 2 |
|
| 3 | + |
| 4 | +/* eslint-disable sonarjs/no-duplicate-string */ |
3 | 5 | export const KNIP_PLUGIN_SLUG = 'knip'; |
4 | 6 | export const KNIP_RAW_REPORT_NAME = 'knip-raw-report.json'; |
5 | 7 | export const KNIP_REPORT_NAME = 'knip-code-pushup-report.json'; |
6 | 8 |
|
| 9 | +const KNIP_DOCS_BASE_URL = 'https://knip.dev/guides/handling-issues'; |
| 10 | + |
7 | 11 | const audits = [ |
8 | 12 | { |
9 | 13 | slug: 'files', |
10 | 14 | title: 'Unused Files', |
11 | 15 | description: 'Unable to find a reference to this file', |
12 | | - docsUrl: 'https://knip.dev/guides/handling-issues#files', |
| 16 | + docsUrl: `${KNIP_DOCS_BASE_URL}#files`, |
13 | 17 | }, |
14 | 18 | { |
15 | 19 | slug: 'dependencies', |
16 | 20 | title: 'Unused Dependencies', |
17 | 21 | description: 'Unable to find a reference to this dependency', |
18 | | - docsUrl: 'https://knip.dev/guides/handling-issues#dependencies', |
| 22 | + docsUrl: `${KNIP_DOCS_BASE_URL}#dependencies`, |
19 | 23 | }, |
20 | 24 | { |
21 | 25 | slug: 'dev-dependencies', |
22 | 26 | title: 'Unused Development Dependencies', |
23 | 27 | description: 'Unable to find a reference to this devDependency', |
24 | | - docsUrl: 'https://knip.dev/guides/handling-issues#devDependencies', |
| 28 | + docsUrl: `${KNIP_DOCS_BASE_URL}#devDependencies`, |
25 | 29 | }, |
26 | 30 | { |
27 | 31 | slug: 'optional-peer-dependencies', |
28 | 32 | title: 'Referenced optional peerDependencies', |
29 | 33 | description: 'Optional peer dependency is referenced', |
30 | | - docsUrl: |
31 | | - 'https://knip.dev/guides/handling-issues#referenced-optional-peerDependencies', |
| 34 | + docsUrl: `${KNIP_DOCS_BASE_URL}#referenced-optional-peerDependencies`, |
32 | 35 | }, |
33 | 36 | { |
34 | 37 | slug: 'unlisted', |
35 | 38 | title: 'Unlisted dependencies', |
36 | 39 | description: 'Used dependencies not listed in package.json', |
37 | | - docsUrl: 'https://knip.dev/guides/handling-issues#unlisted', |
| 40 | + docsUrl: `${KNIP_DOCS_BASE_URL}#unlisted`, |
38 | 41 | }, |
39 | 42 | { |
40 | 43 | slug: 'binaries', |
41 | 44 | title: 'Unlisted binaries', |
42 | 45 | description: 'Binaries from dependencies not listed in package.json', |
43 | | - docsUrl: 'https://knip.dev/guides/handling-issues#binaries', |
| 46 | + docsUrl: `${KNIP_DOCS_BASE_URL}#binaries`, |
44 | 47 | }, |
45 | 48 | { |
46 | 49 | slug: 'unresolved', |
47 | 50 | title: 'Unresolved imports', |
48 | 51 | description: 'Unable to resolve this (import) specifier', |
49 | | - docsUrl: 'https://knip.dev/guides/handling-issues#unresolved', |
| 52 | + docsUrl: `${KNIP_DOCS_BASE_URL}#unresolved`, |
50 | 53 | }, |
51 | 54 | { |
52 | 55 | slug: 'exports', |
53 | 56 | title: 'Unused exports', |
54 | 57 | description: 'Unable to find a reference to this export', |
55 | | - docsUrl: 'https://knip.dev/guides/handling-issues#exports', |
| 58 | + docsUrl: `${KNIP_DOCS_BASE_URL}#exports`, |
56 | 59 | }, |
57 | 60 | { |
58 | 61 | slug: 'types', |
59 | 62 | title: 'Unused exported types', |
60 | 63 | description: 'Unable to find a reference to this exported type', |
61 | | - docsUrl: 'https://knip.dev/guides/handling-issues#types', |
| 64 | + docsUrl: `${KNIP_DOCS_BASE_URL}#types`, |
62 | 65 | }, |
63 | 66 | { |
64 | 67 | slug: 'ns-exports', |
65 | 68 | title: 'Exports in used namespace', |
66 | 69 | description: 'Namespace with export is referenced, but not export itself', |
67 | | - docsUrl: 'https://knip.dev/guides/handling-issues#nsExports', |
| 70 | + docsUrl: `${KNIP_DOCS_BASE_URL}#nsExports`, |
68 | 71 | }, |
69 | 72 | { |
70 | 73 | slug: 'ns-types', |
71 | 74 | title: 'Exported types in used namespace', |
72 | 75 | description: 'Namespace with type is referenced, but not type itself', |
73 | | - docsUrl: 'https://knip.dev/guides/handling-issues#nsTypes', |
| 76 | + docsUrl: `${KNIP_DOCS_BASE_URL}#nsTypes`, |
74 | 77 | }, |
75 | 78 | { |
76 | 79 | slug: 'enum-members', |
77 | 80 | title: 'Unused exported enum members', |
78 | 81 | description: 'Unable to find a reference to this enum member', |
79 | | - docsUrl: 'https://knip.dev/guides/handling-issues#enumMembers', |
| 82 | + docsUrl: `${KNIP_DOCS_BASE_URL}#enumMembers`, |
80 | 83 | }, |
81 | 84 | { |
82 | 85 | slug: 'class-members', |
83 | 86 | title: 'Unused exported class members', |
84 | 87 | description: 'Unable to find a reference to this class member', |
85 | | - docsUrl: 'https://knip.dev/guides/handling-issues#classMembers', |
| 88 | + docsUrl: `${KNIP_DOCS_BASE_URL}#classMembers`, |
86 | 89 | }, |
87 | 90 | { |
88 | 91 | slug: 'duplicates', |
89 | 92 | title: 'Duplicate exports', |
90 | 93 | description: 'This is exported more than once', |
91 | | - docsUrl: 'https://knip.dev/guides/handling-issues#duplicates', |
| 94 | + docsUrl: `${KNIP_DOCS_BASE_URL}#duplicates`, |
92 | 95 | }, |
93 | 96 | ] as const; |
94 | 97 |
|
@@ -193,3 +196,4 @@ export const ISSUE_TYPES = [ |
193 | 196 | ...ISSUE_SET_TYPES, |
194 | 197 | ...ISSUE_RECORDS_TYPES, |
195 | 198 | ] as const satisfies KnipIssueType[]; |
| 199 | +/* eslint-enable sonarjs/no-duplicate-string */ |
0 commit comments