knip 0.0.0-angular.0

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.
Files changed (326) hide show
  1. package/README.md +907 -0
  2. package/dist/ConfigurationChief.d.ts +53 -0
  3. package/dist/ConfigurationChief.js +297 -0
  4. package/dist/ConfigurationValidator.d.ts +2325 -0
  5. package/dist/ConfigurationValidator.js +119 -0
  6. package/dist/ConsoleStreamer.d.ts +12 -0
  7. package/dist/ConsoleStreamer.js +34 -0
  8. package/dist/DependencyDeputy.d.ts +64 -0
  9. package/dist/DependencyDeputy.js +254 -0
  10. package/dist/IssueCollector.d.ts +27 -0
  11. package/dist/IssueCollector.js +52 -0
  12. package/dist/PrincipalFactory.d.ts +25 -0
  13. package/dist/PrincipalFactory.js +56 -0
  14. package/dist/ProjectPrincipal.d.ts +64 -0
  15. package/dist/ProjectPrincipal.js +197 -0
  16. package/dist/WorkspaceWorker.d.ts +56 -0
  17. package/dist/WorkspaceWorker.js +244 -0
  18. package/dist/binaries/bash-parser.d.ts +6 -0
  19. package/dist/binaries/bash-parser.js +58 -0
  20. package/dist/binaries/index.d.ts +2 -0
  21. package/dist/binaries/index.js +18 -0
  22. package/dist/binaries/resolvers/c8.d.ts +2 -0
  23. package/dist/binaries/resolvers/c8.js +10 -0
  24. package/dist/binaries/resolvers/dotenv.d.ts +2 -0
  25. package/dist/binaries/resolvers/dotenv.js +6 -0
  26. package/dist/binaries/resolvers/fallback.d.ts +2 -0
  27. package/dist/binaries/resolvers/fallback.js +22 -0
  28. package/dist/binaries/resolvers/index.d.ts +8 -0
  29. package/dist/binaries/resolvers/index.js +8 -0
  30. package/dist/binaries/resolvers/node.d.ts +2 -0
  31. package/dist/binaries/resolvers/node.js +10 -0
  32. package/dist/binaries/resolvers/nodemon.d.ts +2 -0
  33. package/dist/binaries/resolvers/nodemon.js +15 -0
  34. package/dist/binaries/resolvers/npx.d.ts +2 -0
  35. package/dist/binaries/resolvers/npx.js +20 -0
  36. package/dist/binaries/resolvers/pnpm.d.ts +2 -0
  37. package/dist/binaries/resolvers/pnpm.js +63 -0
  38. package/dist/binaries/resolvers/rollup.d.ts +2 -0
  39. package/dist/binaries/resolvers/rollup.js +11 -0
  40. package/dist/binaries/resolvers/yarn.d.ts +2 -0
  41. package/dist/binaries/resolvers/yarn.js +48 -0
  42. package/dist/binaries/types.d.ts +15 -0
  43. package/dist/binaries/types.js +1 -0
  44. package/dist/binaries/util.d.ts +8 -0
  45. package/dist/binaries/util.js +33 -0
  46. package/dist/cli.d.ts +2 -0
  47. package/dist/cli.js +72 -0
  48. package/dist/constants.d.ts +12 -0
  49. package/dist/constants.js +90 -0
  50. package/dist/index.d.ts +10 -0
  51. package/dist/index.js +334 -0
  52. package/dist/issues/initializers.d.ts +4 -0
  53. package/dist/issues/initializers.js +11 -0
  54. package/dist/manifest/helpers.d.ts +7 -0
  55. package/dist/manifest/helpers.js +16 -0
  56. package/dist/manifest/index.d.ts +16 -0
  57. package/dist/manifest/index.js +56 -0
  58. package/dist/plugins/_template/index.d.ts +9 -0
  59. package/dist/plugins/_template/index.js +14 -0
  60. package/dist/plugins/_template/types.d.ts +3 -0
  61. package/dist/plugins/_template/types.js +1 -0
  62. package/dist/plugins/angular/index.d.ts +6 -0
  63. package/dist/plugins/angular/index.js +36 -0
  64. package/dist/plugins/angular/types.d.ts +745 -0
  65. package/dist/plugins/angular/types.js +1 -0
  66. package/dist/plugins/ava/index.d.ts +7 -0
  67. package/dist/plugins/ava/index.js +20 -0
  68. package/dist/plugins/ava/types.d.ts +4 -0
  69. package/dist/plugins/ava/types.js +1 -0
  70. package/dist/plugins/babel/helpers.d.ts +15 -0
  71. package/dist/plugins/babel/helpers.js +34 -0
  72. package/dist/plugins/babel/index.d.ts +8 -0
  73. package/dist/plugins/babel/index.js +30 -0
  74. package/dist/plugins/babel/types.d.ts +9 -0
  75. package/dist/plugins/babel/types.js +1 -0
  76. package/dist/plugins/capacitor/index.d.ts +6 -0
  77. package/dist/plugins/capacitor/index.js +11 -0
  78. package/dist/plugins/capacitor/types.d.ts +3 -0
  79. package/dist/plugins/capacitor/types.js +1 -0
  80. package/dist/plugins/changesets/index.d.ts +6 -0
  81. package/dist/plugins/changesets/index.js +15 -0
  82. package/dist/plugins/commitizen/index.d.ts +6 -0
  83. package/dist/plugins/commitizen/index.js +14 -0
  84. package/dist/plugins/commitizen/types.d.ts +3 -0
  85. package/dist/plugins/commitizen/types.js +1 -0
  86. package/dist/plugins/commitlint/index.d.ts +6 -0
  87. package/dist/plugins/commitlint/index.js +18 -0
  88. package/dist/plugins/cspell/index.d.ts +6 -0
  89. package/dist/plugins/cspell/index.js +17 -0
  90. package/dist/plugins/cspell/types.d.ts +3 -0
  91. package/dist/plugins/cspell/types.js +1 -0
  92. package/dist/plugins/cypress/index.d.ts +5 -0
  93. package/dist/plugins/cypress/index.js +10 -0
  94. package/dist/plugins/eslint/fallback.d.ts +1 -0
  95. package/dist/plugins/eslint/fallback.js +13 -0
  96. package/dist/plugins/eslint/helpers.d.ts +14 -0
  97. package/dist/plugins/eslint/helpers.js +83 -0
  98. package/dist/plugins/eslint/index.d.ts +7 -0
  99. package/dist/plugins/eslint/index.js +15 -0
  100. package/dist/plugins/eslint/types.d.ts +27 -0
  101. package/dist/plugins/eslint/types.js +1 -0
  102. package/dist/plugins/gatsby/index.d.ts +7 -0
  103. package/dist/plugins/gatsby/index.js +30 -0
  104. package/dist/plugins/gatsby/types.d.ts +15 -0
  105. package/dist/plugins/gatsby/types.js +1 -0
  106. package/dist/plugins/github-actions/index.d.ts +6 -0
  107. package/dist/plugins/github-actions/index.js +21 -0
  108. package/dist/plugins/husky/index.d.ts +6 -0
  109. package/dist/plugins/husky/index.js +19 -0
  110. package/dist/plugins/index.d.ts +41 -0
  111. package/dist/plugins/index.js +41 -0
  112. package/dist/plugins/jest/index.d.ts +7 -0
  113. package/dist/plugins/jest/index.js +68 -0
  114. package/dist/plugins/lefthook/index.d.ts +6 -0
  115. package/dist/plugins/lefthook/index.js +28 -0
  116. package/dist/plugins/lint-staged/index.d.ts +6 -0
  117. package/dist/plugins/lint-staged/index.js +32 -0
  118. package/dist/plugins/lint-staged/types.d.ts +5 -0
  119. package/dist/plugins/lint-staged/types.js +1 -0
  120. package/dist/plugins/markdownlint/helpers.d.ts +1 -0
  121. package/dist/plugins/markdownlint/helpers.js +6 -0
  122. package/dist/plugins/markdownlint/index.d.ts +6 -0
  123. package/dist/plugins/markdownlint/index.js +19 -0
  124. package/dist/plugins/markdownlint/types.d.ts +3 -0
  125. package/dist/plugins/markdownlint/types.js +1 -0
  126. package/dist/plugins/mocha/index.d.ts +6 -0
  127. package/dist/plugins/mocha/index.js +15 -0
  128. package/dist/plugins/next/index.d.ts +6 -0
  129. package/dist/plugins/next/index.js +11 -0
  130. package/dist/plugins/npm-package-json-lint/index.d.ts +6 -0
  131. package/dist/plugins/npm-package-json-lint/index.js +13 -0
  132. package/dist/plugins/npm-package-json-lint/types.d.ts +3 -0
  133. package/dist/plugins/npm-package-json-lint/types.js +1 -0
  134. package/dist/plugins/nx/index.d.ts +6 -0
  135. package/dist/plugins/nx/index.js +24 -0
  136. package/dist/plugins/nx/types.d.ts +11 -0
  137. package/dist/plugins/nx/types.js +1 -0
  138. package/dist/plugins/nyc/index.d.ts +6 -0
  139. package/dist/plugins/nyc/index.js +11 -0
  140. package/dist/plugins/playwright/index.d.ts +5 -0
  141. package/dist/plugins/playwright/index.js +5 -0
  142. package/dist/plugins/postcss/index.d.ts +6 -0
  143. package/dist/plugins/postcss/index.js +23 -0
  144. package/dist/plugins/postcss/types.d.ts +3 -0
  145. package/dist/plugins/postcss/types.js +1 -0
  146. package/dist/plugins/prettier/index.d.ts +6 -0
  147. package/dist/plugins/prettier/index.js +20 -0
  148. package/dist/plugins/release-it/index.d.ts +6 -0
  149. package/dist/plugins/release-it/index.js +30 -0
  150. package/dist/plugins/release-it/types.d.ts +10 -0
  151. package/dist/plugins/release-it/types.js +1 -0
  152. package/dist/plugins/remark/index.d.ts +6 -0
  153. package/dist/plugins/remark/index.js +18 -0
  154. package/dist/plugins/remix/index.d.ts +6 -0
  155. package/dist/plugins/remix/index.js +11 -0
  156. package/dist/plugins/rollup/index.d.ts +5 -0
  157. package/dist/plugins/rollup/index.js +5 -0
  158. package/dist/plugins/semantic-release/index.d.ts +6 -0
  159. package/dist/plugins/semantic-release/index.js +17 -0
  160. package/dist/plugins/semantic-release/types.d.ts +3 -0
  161. package/dist/plugins/semantic-release/types.js +1 -0
  162. package/dist/plugins/sentry/index.d.ts +5 -0
  163. package/dist/plugins/sentry/index.js +5 -0
  164. package/dist/plugins/storybook/index.d.ts +8 -0
  165. package/dist/plugins/storybook/index.js +19 -0
  166. package/dist/plugins/storybook/types.d.ts +11 -0
  167. package/dist/plugins/storybook/types.js +1 -0
  168. package/dist/plugins/stryker/index.d.ts +6 -0
  169. package/dist/plugins/stryker/index.js +17 -0
  170. package/dist/plugins/stryker/types.d.ts +5 -0
  171. package/dist/plugins/stryker/types.js +1 -0
  172. package/dist/plugins/stylelint/index.d.ts +6 -0
  173. package/dist/plugins/stylelint/index.js +22 -0
  174. package/dist/plugins/stylelint/types.d.ts +4 -0
  175. package/dist/plugins/stylelint/types.js +1 -0
  176. package/dist/plugins/svelte/index.d.ts +7 -0
  177. package/dist/plugins/svelte/index.js +9 -0
  178. package/dist/plugins/tailwind/index.d.ts +5 -0
  179. package/dist/plugins/tailwind/index.js +5 -0
  180. package/dist/plugins/typedoc/index.d.ts +6 -0
  181. package/dist/plugins/typedoc/index.js +22 -0
  182. package/dist/plugins/typedoc/types.d.ts +3 -0
  183. package/dist/plugins/typedoc/types.js +1 -0
  184. package/dist/plugins/typescript/index.d.ts +7 -0
  185. package/dist/plugins/typescript/index.js +42 -0
  186. package/dist/plugins/vite/index.d.ts +6 -0
  187. package/dist/plugins/vite/index.js +12 -0
  188. package/dist/plugins/vite/types.d.ts +4 -0
  189. package/dist/plugins/vite/types.js +1 -0
  190. package/dist/plugins/vitest/helpers.d.ts +6 -0
  191. package/dist/plugins/vitest/helpers.js +22 -0
  192. package/dist/plugins/vitest/index.d.ts +9 -0
  193. package/dist/plugins/vitest/index.js +25 -0
  194. package/dist/plugins/vitest/types.d.ts +11 -0
  195. package/dist/plugins/vitest/types.js +1 -0
  196. package/dist/plugins/webpack/index.d.ts +6 -0
  197. package/dist/plugins/webpack/index.js +82 -0
  198. package/dist/plugins/webpack/types.d.ts +10 -0
  199. package/dist/plugins/webpack/types.js +1 -0
  200. package/dist/reporters/codeowners.d.ts +3 -0
  201. package/dist/reporters/codeowners.js +62 -0
  202. package/dist/reporters/compact.d.ts +3 -0
  203. package/dist/reporters/compact.js +36 -0
  204. package/dist/reporters/index.d.ts +7 -0
  205. package/dist/reporters/index.js +10 -0
  206. package/dist/reporters/json.d.ts +3 -0
  207. package/dist/reporters/json.js +67 -0
  208. package/dist/reporters/symbols.d.ts +3 -0
  209. package/dist/reporters/symbols.js +54 -0
  210. package/dist/reporters/util.d.ts +15 -0
  211. package/dist/reporters/util.js +17 -0
  212. package/dist/types/cli.d.ts +10 -0
  213. package/dist/types/cli.js +1 -0
  214. package/dist/types/compilers.d.ts +6 -0
  215. package/dist/types/compilers.js +1 -0
  216. package/dist/types/config.d.ts +39 -0
  217. package/dist/types/config.js +3 -0
  218. package/dist/types/exports.d.ts +20 -0
  219. package/dist/types/exports.js +1 -0
  220. package/dist/types/imports.d.ts +13 -0
  221. package/dist/types/imports.js +1 -0
  222. package/dist/types/issues.d.ts +62 -0
  223. package/dist/types/issues.js +10 -0
  224. package/dist/types/plugins.d.ts +19 -0
  225. package/dist/types/plugins.js +1 -0
  226. package/dist/types/workspace.d.ts +17 -0
  227. package/dist/types/workspace.js +1 -0
  228. package/dist/typescript/SourceFile.d.ts +18 -0
  229. package/dist/typescript/SourceFile.js +1 -0
  230. package/dist/typescript/SourceFileManager.d.ts +13 -0
  231. package/dist/typescript/SourceFileManager.js +57 -0
  232. package/dist/typescript/ast-helpers.d.ts +27 -0
  233. package/dist/typescript/ast-helpers.js +101 -0
  234. package/dist/typescript/createHosts.d.ts +15 -0
  235. package/dist/typescript/createHosts.js +39 -0
  236. package/dist/typescript/getImportsAndExports.d.ts +29 -0
  237. package/dist/typescript/getImportsAndExports.js +159 -0
  238. package/dist/typescript/resolveModuleNames.d.ts +2 -0
  239. package/dist/typescript/resolveModuleNames.js +27 -0
  240. package/dist/typescript/sys.d.ts +35 -0
  241. package/dist/typescript/sys.js +16 -0
  242. package/dist/typescript/utils.d.ts +2 -0
  243. package/dist/typescript/utils.js +9 -0
  244. package/dist/typescript/visitors/exports/exportAssignment.d.ts +3 -0
  245. package/dist/typescript/visitors/exports/exportAssignment.js +9 -0
  246. package/dist/typescript/visitors/exports/exportDeclaration.d.ts +3 -0
  247. package/dist/typescript/visitors/exports/exportDeclaration.js +13 -0
  248. package/dist/typescript/visitors/exports/exportKeyword.d.ts +3 -0
  249. package/dist/typescript/visitors/exports/exportKeyword.js +77 -0
  250. package/dist/typescript/visitors/exports/index.d.ts +3 -0
  251. package/dist/typescript/visitors/exports/index.js +7 -0
  252. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +3 -0
  253. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.js +31 -0
  254. package/dist/typescript/visitors/helpers.d.ts +4 -0
  255. package/dist/typescript/visitors/helpers.js +10 -0
  256. package/dist/typescript/visitors/imports/importCall.d.ts +3 -0
  257. package/dist/typescript/visitors/imports/importCall.js +11 -0
  258. package/dist/typescript/visitors/imports/importDeclaration.d.ts +3 -0
  259. package/dist/typescript/visitors/imports/importDeclaration.js +32 -0
  260. package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +3 -0
  261. package/dist/typescript/visitors/imports/importEqualsDeclaration.js +11 -0
  262. package/dist/typescript/visitors/imports/index.d.ts +3 -0
  263. package/dist/typescript/visitors/imports/index.js +18 -0
  264. package/dist/typescript/visitors/imports/jsDocType.d.ts +3 -0
  265. package/dist/typescript/visitors/imports/jsDocType.js +11 -0
  266. package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +3 -0
  267. package/dist/typescript/visitors/imports/reExportDeclaration.js +21 -0
  268. package/dist/typescript/visitors/imports/requireCall.d.ts +3 -0
  269. package/dist/typescript/visitors/imports/requireCall.js +45 -0
  270. package/dist/typescript/visitors/imports/requireResolveCall.d.ts +3 -0
  271. package/dist/typescript/visitors/imports/requireResolveCall.js +12 -0
  272. package/dist/typescript/visitors/index.d.ts +10 -0
  273. package/dist/typescript/visitors/index.js +16 -0
  274. package/dist/typescript/visitors/scripts/execa.d.ts +3 -0
  275. package/dist/typescript/visitors/scripts/execa.js +18 -0
  276. package/dist/typescript/visitors/scripts/index.d.ts +3 -0
  277. package/dist/typescript/visitors/scripts/index.js +5 -0
  278. package/dist/typescript/visitors/scripts/zx.d.ts +3 -0
  279. package/dist/typescript/visitors/scripts/zx.js +8 -0
  280. package/dist/util/Performance.d.ts +23 -0
  281. package/dist/util/Performance.js +80 -0
  282. package/dist/util/array.d.ts +2 -0
  283. package/dist/util/array.js +2 -0
  284. package/dist/util/cli-arguments.d.ts +28 -0
  285. package/dist/util/cli-arguments.js +83 -0
  286. package/dist/util/compilers.d.ts +426 -0
  287. package/dist/util/compilers.js +20 -0
  288. package/dist/util/debug.d.ts +3 -0
  289. package/dist/util/debug.js +34 -0
  290. package/dist/util/errors.d.ts +12 -0
  291. package/dist/util/errors.js +14 -0
  292. package/dist/util/fs.d.ts +7 -0
  293. package/dist/util/fs.js +42 -0
  294. package/dist/util/get-included-issue-types.d.ts +16 -0
  295. package/dist/util/get-included-issue-types.js +37 -0
  296. package/dist/util/git.d.ts +1 -0
  297. package/dist/util/git.js +20 -0
  298. package/dist/util/glob.d.ts +19 -0
  299. package/dist/util/glob.js +59 -0
  300. package/dist/util/loader.d.ts +1 -0
  301. package/dist/util/loader.js +31 -0
  302. package/dist/util/map.d.ts +1 -0
  303. package/dist/util/map.js +6 -0
  304. package/dist/util/modules.d.ts +8 -0
  305. package/dist/util/modules.js +52 -0
  306. package/dist/util/object.d.ts +3 -0
  307. package/dist/util/object.js +37 -0
  308. package/dist/util/path.d.ts +11 -0
  309. package/dist/util/path.js +13 -0
  310. package/dist/util/plugin.d.ts +3 -0
  311. package/dist/util/plugin.js +14 -0
  312. package/dist/util/register.d.ts +1 -0
  313. package/dist/util/register.js +14 -0
  314. package/dist/util/reporter.d.ts +3 -0
  315. package/dist/util/reporter.js +16 -0
  316. package/dist/util/require.d.ts +5 -0
  317. package/dist/util/require.js +34 -0
  318. package/dist/util/tsconfig-loader.d.ts +2 -0
  319. package/dist/util/tsconfig-loader.js +11 -0
  320. package/dist/util/workspace.d.ts +1 -0
  321. package/dist/util/workspace.js +11 -0
  322. package/dist/version.d.ts +1 -0
  323. package/dist/version.js +1 -0
  324. package/license +12 -0
  325. package/package.json +150 -0
  326. package/schema.json +403 -0
@@ -0,0 +1,11 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Remix';
3
+ export const ENABLERS = [/^@remix-run\//];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const ENTRY_FILE_PATTERNS = ['remix.config.js', 'remix.init/index.js'];
6
+ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
7
+ 'app/root.tsx',
8
+ 'app/entry.{client,server}.{js,jsx,ts,tsx}',
9
+ 'app/routes/**/*.{js,ts,tsx}',
10
+ 'server.{js,ts}',
11
+ ];
@@ -0,0 +1,5 @@
1
+ import type { IsPluginEnabledCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Rollup";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const ENTRY_FILE_PATTERNS: string[];
@@ -0,0 +1,5 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Rollup';
3
+ export const ENABLERS = ['rollup'];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const ENTRY_FILE_PATTERNS = ['rollup.config.{js,mjs,ts}'];
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Semantic Release";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,17 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Semantic Release';
4
+ export const ENABLERS = ['semantic-release'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = [
7
+ '.releaserc',
8
+ '.releaserc.{yaml,yml,json,js,cjs}',
9
+ 'release.config.{js,cjs}',
10
+ 'package.json',
11
+ ];
12
+ const findSemanticReleaseDependencies = async (configFilePath, { manifest }) => {
13
+ const config = configFilePath.endsWith('package.json') ? manifest.release : await load(configFilePath);
14
+ const plugins = config?.plugins ?? [];
15
+ return plugins.map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
16
+ };
17
+ export const findDependencies = timerify(findSemanticReleaseDependencies);
@@ -0,0 +1,3 @@
1
+ export type PluginConfig = {
2
+ plugins?: (string | [string, Record<string, unknown>])[];
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { IsPluginEnabledCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Sentry";
3
+ export declare const ENABLERS: RegExp[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const ENTRY_FILE_PATTERNS: string[];
@@ -0,0 +1,5 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Sentry';
3
+ export const ENABLERS = [/^@sentry\//];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const ENTRY_FILE_PATTERNS = ['sentry.{client,server,edge}.config.{js,ts}'];
@@ -0,0 +1,8 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Storybook";
3
+ export declare const ENABLERS: (string | RegExp)[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const ENTRY_FILE_PATTERNS: string[];
7
+ export declare const PROJECT_FILE_PATTERNS: string[];
8
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,19 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Storybook';
4
+ export const ENABLERS = [/^@storybook\//, '@nrwl/storybook'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['.storybook/{main,manager}.{js,ts}'];
7
+ export const ENTRY_FILE_PATTERNS = ['.storybook/preview.{js,jsx,ts,tsx}', '**/*.stories.{js,jsx,ts,tsx}'];
8
+ export const PROJECT_FILE_PATTERNS = ['.storybook/**/*.{js,jsx,ts,tsx}'];
9
+ const findStorybookDependencies = async (configFilePath) => {
10
+ const config = await load(configFilePath);
11
+ if (!config)
12
+ return [];
13
+ const addons = config.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
14
+ const builder = config?.core?.builder;
15
+ const builderPackages = builder && /webpack/.test(builder) ? [`@storybook/builder-${builder}`, `@storybook/manager-${builder}`] : [];
16
+ const frameworks = config.framework?.name ? [config.framework.name] : [];
17
+ return [...addons, ...builderPackages, ...frameworks];
18
+ };
19
+ export const findDependencies = timerify(findStorybookDependencies);
@@ -0,0 +1,11 @@
1
+ export type StorybookConfig = {
2
+ addons?: (string | {
3
+ name: string;
4
+ })[];
5
+ core?: {
6
+ builder?: string;
7
+ };
8
+ framework?: {
9
+ name?: string;
10
+ };
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Stryker";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,17 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Stryker';
4
+ export const ENABLERS = ['@stryker-mutator/core'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['?(.)stryker.{conf,config}.{js,mjs,cjs,json}'];
7
+ const findStrykerDependencies = async (configFilePath) => {
8
+ const config = await load(configFilePath);
9
+ if (config) {
10
+ const runners = config.testRunner ? [`@stryker-mutator/${config.testRunner}-runner`] : [];
11
+ const checkers = config.checkers ? config.checkers.map(checker => `@stryker-mutator/${checker}-checker`) : [];
12
+ const plugins = config.plugins ?? [];
13
+ return [...runners, ...checkers, ...plugins];
14
+ }
15
+ return [];
16
+ };
17
+ export const findDependencies = timerify(findStrykerDependencies);
@@ -0,0 +1,5 @@
1
+ export type StrykerConfig = {
2
+ testRunner?: string;
3
+ checkers?: string[];
4
+ plugins?: string[];
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Stylelint";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,22 @@
1
+ import { isInternal } from '../../util/path.js';
2
+ import { timerify } from '../../util/Performance.js';
3
+ import { hasDependency, load } from '../../util/plugin.js';
4
+ export const NAME = 'Stylelint';
5
+ export const ENABLERS = ['stylelint'];
6
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
7
+ export const CONFIG_FILE_PATTERNS = [
8
+ '.stylelintrc',
9
+ '.stylelintrc.{cjs,js,json,yaml,yml}',
10
+ 'stylelint.config.{cjs,mjs,js}',
11
+ ];
12
+ const findPluginDependencies = async (configFilePath, { manifest }) => {
13
+ const config = configFilePath.endsWith('package.json')
14
+ ? manifest.stylelint
15
+ : await load(configFilePath);
16
+ if (!config)
17
+ return [];
18
+ const extend = config.extends ? [config.extends].flat().filter(extend => !isInternal(extend)) : [];
19
+ const plugins = config.plugins ? [config.plugins].flat().filter(plugin => !isInternal(plugin)) : [];
20
+ return [...extend, ...plugins];
21
+ };
22
+ export const findDependencies = timerify(findPluginDependencies);
@@ -0,0 +1,4 @@
1
+ export type PluginConfig = {
2
+ extends?: string | string[];
3
+ plugins?: string[];
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IsPluginEnabledCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Svelte";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const ENTRY_FILE_PATTERNS: string[];
6
+ export declare const PRODUCTION_ENTRY_FILE_PATTERNS: string[];
7
+ export declare const PROJECT_FILE_PATTERNS: string[];
@@ -0,0 +1,9 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Svelte';
3
+ export const ENABLERS = ['svelte'];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const ENTRY_FILE_PATTERNS = ['svelte.config.js', 'vite.config.ts'];
6
+ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
7
+ 'src/routes/**/+{page,server,page.server,error,layout,layout.server}{,@*}.{js,ts,svelte}',
8
+ ];
9
+ export const PROJECT_FILE_PATTERNS = ['src/**/*.{js,ts,svelte}'];
@@ -0,0 +1,5 @@
1
+ import type { IsPluginEnabledCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Tailwind";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
@@ -0,0 +1,5 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Tailwind';
3
+ export const ENABLERS = ['tailwindcss'];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const CONFIG_FILE_PATTERNS = ['tailwind.config.{js,cjs,mjs,ts}'];
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "TypeDoc";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,22 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'TypeDoc';
4
+ export const ENABLERS = ['typedoc'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = [
7
+ 'typedoc.{js,cjs,json,jsonc}',
8
+ 'typedoc.config.{js,cjs}',
9
+ '.config/typedoc.{js,cjs,json,jsonc}',
10
+ '.config/typedoc.config.{js,cjs}',
11
+ 'package.json',
12
+ 'tsconfig.json',
13
+ ];
14
+ const findTypeDocDependencies = async (configFilePath, { manifest }) => {
15
+ const config = configFilePath.endsWith('package.json')
16
+ ? manifest.typedocOptions
17
+ : configFilePath.endsWith('tsconfig.json')
18
+ ? (await load(configFilePath)).typedocOptions
19
+ : await load(configFilePath);
20
+ return config?.plugin ?? [];
21
+ };
22
+ export const findDependencies = timerify(findTypeDocDependencies);
@@ -0,0 +1,3 @@
1
+ export type PluginConfig = {
2
+ plugin?: string[];
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "TypeScript";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findTypeScriptDependencies: GenericPluginCallback;
7
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,42 @@
1
+ import { compact } from '../../util/array.js';
2
+ import { dirname, isInternal, toAbsolute } from '../../util/path.js';
3
+ import { timerify } from '../../util/Performance.js';
4
+ import { hasDependency, load } from '../../util/plugin.js';
5
+ import { loadTSConfig } from '../../util/tsconfig-loader.js';
6
+ export const NAME = 'TypeScript';
7
+ export const ENABLERS = ['typescript'];
8
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
9
+ export const CONFIG_FILE_PATTERNS = ['tsconfig.json'];
10
+ const resolveExtensibleConfig = async (configFilePath) => {
11
+ const config = await load(configFilePath);
12
+ config.extends = config.extends ? [config.extends].flat() : [];
13
+ if (config?.extends) {
14
+ for (const extend of [config.extends].flat()) {
15
+ if (isInternal(extend)) {
16
+ const presetConfigPath = toAbsolute(extend, dirname(configFilePath));
17
+ const presetConfig = await resolveExtensibleConfig(presetConfigPath);
18
+ config.extends.push(...(presetConfig.extends ? [presetConfig.extends].flat() : []));
19
+ }
20
+ }
21
+ }
22
+ return config;
23
+ };
24
+ export const findTypeScriptDependencies = async (configFilePath) => {
25
+ const compilerOptions = await loadTSConfig(configFilePath);
26
+ const config = await resolveExtensibleConfig(configFilePath);
27
+ if (!compilerOptions || !config)
28
+ return [];
29
+ const extend = config.extends ? [config.extends].flat().filter(extend => !isInternal(extend)) : [];
30
+ const types = compilerOptions.types ?? [];
31
+ const plugins = Array.isArray(compilerOptions?.plugins)
32
+ ? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
33
+ : [];
34
+ const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
35
+ const jsx = compilerOptions?.jsxImportSource
36
+ ? [compilerOptions.jsxImportSource]
37
+ : compilerOptions?.jsx
38
+ ? ['react']
39
+ : [];
40
+ return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
41
+ };
42
+ export const findDependencies = timerify(findTypeScriptDependencies);
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Vite";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,12 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ import { findVitestDeps } from '../vitest/index.js';
4
+ export const NAME = 'Vite';
5
+ export const ENABLERS = ['vite'];
6
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
7
+ export const CONFIG_FILE_PATTERNS = ['vite.config.{js,ts}'];
8
+ const findViteDependencies = async (configFilePath) => {
9
+ const config = await load(configFilePath);
10
+ return findVitestDeps(config);
11
+ };
12
+ export const findDependencies = timerify(findViteDependencies);
@@ -0,0 +1,4 @@
1
+ import type { VitestConfig } from '../vitest/types.js';
2
+ export interface ViteConfig extends VitestConfig {
3
+ plugins: unknown[];
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { VitestConfig } from './types.js';
2
+ type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
3
+ type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
4
+ export declare const getEnvPackageName: (env: VitestEnvironment) => any;
5
+ export declare const getExternalReporters: (reporters?: VitestConfig['test']['reporters']) => unknown[];
6
+ export {};
@@ -0,0 +1,22 @@
1
+ const environments = {
2
+ node: null,
3
+ jsdom: null,
4
+ 'happy-dom': null,
5
+ 'edge-runtime': null,
6
+ };
7
+ const envPackageNames = {
8
+ jsdom: 'jsdom',
9
+ 'happy-dom': 'happy-dom',
10
+ 'edge-runtime': '@edge-runtime/vm',
11
+ };
12
+ export const getEnvPackageName = (env) => {
13
+ if (env === 'node')
14
+ return null;
15
+ if (env in envPackageNames)
16
+ return envPackageNames[env];
17
+ return `vitest-environment-${env}`;
18
+ };
19
+ const builtInReporters = ['default', 'verbose', 'dot', 'json', 'tap', 'tap-flat', 'junit', 'hanging-process'];
20
+ export const getExternalReporters = (reporters) => reporters
21
+ ? [reporters].flat().filter(reporter => typeof reporter === 'string' && !builtInReporters.includes(reporter))
22
+ : [];
@@ -0,0 +1,9 @@
1
+ import type { VitestConfig } from './types.js';
2
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
3
+ export declare const NAME = "Vitest";
4
+ export declare const ENABLERS: string[];
5
+ export declare const isEnabled: IsPluginEnabledCallback;
6
+ export declare const CONFIG_FILE_PATTERNS: string[];
7
+ export declare const ENTRY_FILE_PATTERNS: never[];
8
+ export declare const findVitestDeps: (config: VitestConfig) => any[];
9
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,25 @@
1
+ import { compact } from '../../util/array.js';
2
+ import { timerify } from '../../util/Performance.js';
3
+ import { hasDependency, load } from '../../util/plugin.js';
4
+ import { getEnvPackageName, getExternalReporters } from './helpers.js';
5
+ export const NAME = 'Vitest';
6
+ export const ENABLERS = ['vitest'];
7
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
8
+ export const CONFIG_FILE_PATTERNS = ['vitest.config.ts'];
9
+ export const ENTRY_FILE_PATTERNS = [];
10
+ export const findVitestDeps = (config) => {
11
+ if (!config || !config.test)
12
+ return [];
13
+ const cfg = config.test;
14
+ const environments = cfg.environment ? [getEnvPackageName(cfg.environment)] : [];
15
+ const reporters = getExternalReporters(cfg.reporters);
16
+ const coverage = cfg.coverage ? [`@vitest/coverage-${cfg.coverage.provider ?? 'v8'}`] : [];
17
+ const setupFiles = cfg.setupFiles ? [cfg.setupFiles].flat() : [];
18
+ const globalSetup = cfg.globalSetup ? [cfg.globalSetup].flat() : [];
19
+ return compact([...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup]);
20
+ };
21
+ const findVitestDependencies = async (configFilePath) => {
22
+ const config = await load(configFilePath);
23
+ return findVitestDeps(config);
24
+ };
25
+ export const findDependencies = timerify(findVitestDependencies);
@@ -0,0 +1,11 @@
1
+ export interface VitestConfig {
2
+ test: {
3
+ coverage?: {
4
+ provider: string;
5
+ };
6
+ environment?: string;
7
+ globalSetup?: string | string[];
8
+ reporters?: (string | unknown)[];
9
+ setupFiles?: string | string[];
10
+ };
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Webpack";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,82 @@
1
+ import { compact } from '../../util/array.js';
2
+ import { join } from '../../util/path.js';
3
+ import { timerify } from '../../util/Performance.js';
4
+ import { hasDependency, load } from '../../util/plugin.js';
5
+ import { getDependenciesFromConfig } from '../babel/index.js';
6
+ export const NAME = 'Webpack';
7
+ export const ENABLERS = ['webpack'];
8
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
9
+ export const CONFIG_FILE_PATTERNS = ['webpack.config*.{js,ts}'];
10
+ const hasBabelOptions = (use) => Boolean(use) &&
11
+ typeof use !== 'string' &&
12
+ 'loader' in use &&
13
+ typeof use.loader === 'string' &&
14
+ use.loader === 'babel-loader' &&
15
+ typeof use.options === 'object';
16
+ const info = { compiler: '', issuer: '', realResource: '', resource: '', resourceQuery: '' };
17
+ const resolveRuleSetDependencies = (rule) => {
18
+ if (!rule || typeof rule === 'string')
19
+ return [];
20
+ if (typeof rule.use === 'string')
21
+ return [rule.use];
22
+ let useItem = rule.use ?? rule.loader ?? rule;
23
+ if (typeof useItem === 'function')
24
+ useItem = useItem(info);
25
+ return [useItem].flat().flatMap((useItem) => {
26
+ if (!useItem)
27
+ return [];
28
+ if (hasBabelOptions(useItem)) {
29
+ return [
30
+ ...resolveUseItem(useItem),
31
+ ...getDependenciesFromConfig(useItem.options),
32
+ ];
33
+ }
34
+ return resolveUseItem(useItem);
35
+ });
36
+ };
37
+ const resolveUseItem = (use) => {
38
+ if (!use)
39
+ return [];
40
+ if (typeof use === 'string')
41
+ return [use];
42
+ if ('loader' in use && typeof use.loader === 'string')
43
+ return [use.loader];
44
+ return [];
45
+ };
46
+ const findWebpackDependencies = async (configFilePath, { manifest, isProduction }) => {
47
+ const config = await load(configFilePath);
48
+ if (!config)
49
+ return [];
50
+ const passes = typeof config === 'function' ? [false, true] : [isProduction];
51
+ const dependencies = passes.flatMap(isProduction => {
52
+ const env = { production: isProduction };
53
+ const argv = { mode: isProduction ? 'production' : 'development' };
54
+ const cfg = typeof config === 'function' ? config(env, argv) : config;
55
+ return [cfg].flat().flatMap(config => {
56
+ const dependencies = (config.module?.rules?.flatMap(resolveRuleSetDependencies) ?? []).map(loader => loader.replace(/\?.*/, ''));
57
+ const entries = [];
58
+ if (typeof cfg.entry === 'string')
59
+ entries.push(cfg.entry);
60
+ else if (Array.isArray(cfg.entry))
61
+ entries.push(...cfg.entry);
62
+ else if (typeof cfg.entry === 'object') {
63
+ Object.values(cfg.entry).map(entry => {
64
+ if (typeof entry === 'string')
65
+ entries.push(entry);
66
+ else if (Array.isArray(entry))
67
+ entries.push(...entry);
68
+ else if (typeof entry === 'function')
69
+ entries.push(entry());
70
+ else if (entry && typeof entry === 'object' && 'filename' in entry)
71
+ entries.push(entry['filename']);
72
+ });
73
+ }
74
+ return [...dependencies, ...entries.map(entry => (config.context ? join(config.context, entry) : entry))];
75
+ });
76
+ });
77
+ const scripts = Object.values(manifest.scripts ?? {});
78
+ const webpackCLI = scripts.some(script => script?.includes('webpack ')) ? ['webpack-cli'] : [];
79
+ const webpackDevServer = scripts.some(script => script?.includes('webpack serve')) ? ['webpack-dev-server'] : [];
80
+ return compact([...dependencies, ...webpackCLI, ...webpackDevServer]);
81
+ };
82
+ export const findDependencies = timerify(findWebpackDependencies);
@@ -0,0 +1,10 @@
1
+ import type { Configuration } from 'webpack';
2
+ type Mode = 'none' | 'development' | 'production';
3
+ export type Env = {
4
+ production: boolean;
5
+ };
6
+ export type Argv = {
7
+ mode: Mode;
8
+ };
9
+ export type WebpackConfig = Configuration | ((env: Env, argv: Argv) => Configuration);
10
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { ReporterOptions } from '../types/issues.js';
2
+ declare const _default: ({ report, issues, isShowProgress, options }: ReporterOptions) => void;
3
+ export default _default;
@@ -0,0 +1,62 @@
1
+ import { OwnershipEngine } from '@snyk/github-codeowners/dist/lib/ownership/index.js';
2
+ import chalk from 'chalk';
3
+ import { toRelative, relative, resolve } from '../util/path.js';
4
+ import { getTitle, logTitle, logIssueLine } from './util.js';
5
+ const logIssueSet = (issues) => {
6
+ issues
7
+ .sort((a, b) => (a.owner < b.owner ? -1 : 1))
8
+ .forEach(issue => console.log(chalk.cyan(issue.owner), toRelative(issue.symbol)));
9
+ };
10
+ const logIssueRecord = (issues) => {
11
+ const sortedByFilePath = issues.sort((a, b) => (a.owner < b.owner ? -1 : 1));
12
+ sortedByFilePath.forEach(({ filePath, symbols, owner, parentSymbol }) => logIssueLine({ owner, filePath, symbols, parentSymbol }));
13
+ };
14
+ export default ({ report, issues, isShowProgress, options }) => {
15
+ let opts = {};
16
+ try {
17
+ opts = options ? JSON.parse(options) : opts;
18
+ }
19
+ catch (error) {
20
+ console.error(error);
21
+ }
22
+ const codeownersFilePath = resolve(opts.path ?? '.github/CODEOWNERS');
23
+ const codeownersEngine = OwnershipEngine.FromCodeownersFile(codeownersFilePath);
24
+ const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
25
+ const [dependenciesOwner = '[no-owner]'] = codeownersEngine.calcFileOwnership('package.json');
26
+ const fallbackOwner = dependenciesOwner;
27
+ let totalIssues = 0;
28
+ const calcFileOwnership = (filePath) => codeownersEngine.calcFileOwnership(relative(filePath))[0] ?? fallbackOwner;
29
+ const addOwner = (issue) => ({ ...issue, owner: calcFileOwnership(issue.filePath) });
30
+ for (const [reportType, isReportType] of Object.entries(report)) {
31
+ if (isReportType) {
32
+ const title = reportMultipleGroups && getTitle(reportType);
33
+ const isSet = issues[reportType] instanceof Set;
34
+ const toIssue = (filePath) => ({ type: reportType, filePath, symbol: filePath });
35
+ const issuesForType = issues[reportType] instanceof Set
36
+ ? Array.from(issues[reportType])
37
+ .map(toIssue)
38
+ .map(addOwner)
39
+ : reportType === 'duplicates'
40
+ ? Object.values(issues[reportType]).map(Object.values).flat().map(addOwner)
41
+ : Object.values(issues[reportType]).map(issues => {
42
+ const items = Object.values(issues);
43
+ return addOwner({ ...items[0], symbols: items.map(issue => issue.symbol) });
44
+ });
45
+ if (issuesForType.length > 0) {
46
+ if (totalIssues)
47
+ console.log();
48
+ title && logTitle(title, issuesForType.length);
49
+ if (isSet) {
50
+ logIssueSet(issuesForType);
51
+ }
52
+ else {
53
+ logIssueRecord(issuesForType);
54
+ }
55
+ }
56
+ totalIssues = totalIssues + issuesForType.length;
57
+ }
58
+ }
59
+ if (totalIssues === 0 && isShowProgress) {
60
+ console.log('✂️ Excellent, Knip found no issues.');
61
+ }
62
+ };
@@ -0,0 +1,3 @@
1
+ import type { ReporterOptions } from '../types/issues.js';
2
+ declare const _default: ({ report, issues, isShowProgress }: ReporterOptions) => void;
3
+ export default _default;