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 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Ava";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const ENTRY_FILE_PATTERNS: never[];
7
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,20 @@
1
+ import { _getDependenciesFromScripts } from '../../binaries/index.js';
2
+ import { timerify } from '../../util/Performance.js';
3
+ import { hasDependency, load } from '../../util/plugin.js';
4
+ export const NAME = 'Ava';
5
+ export const ENABLERS = ['ava'];
6
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
7
+ export const CONFIG_FILE_PATTERNS = ['ava.config.{js,cjs,mjs}', 'package.json'];
8
+ export const ENTRY_FILE_PATTERNS = [];
9
+ const findAvaDependencies = async (configFilePath, { cwd, manifest }) => {
10
+ const config = configFilePath.endsWith('package.json') ? manifest.ava : await load(configFilePath);
11
+ const requireArgs = (config?.require ?? []).map(require => `--require ${require}`);
12
+ const otherArgs = config?.nodeArguments ?? [];
13
+ const cmd = `node ${otherArgs.join(' ')} ${requireArgs.join(' ')}`;
14
+ return _getDependenciesFromScripts([cmd], {
15
+ cwd,
16
+ manifest,
17
+ knownGlobalsOnly: true,
18
+ });
19
+ };
20
+ export const findDependencies = timerify(findAvaDependencies);
@@ -0,0 +1,4 @@
1
+ export type PluginConfig = {
2
+ require?: string[];
3
+ nodeArguments?: string[];
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ export declare const resolvePluginName: (pluginName: string) => string;
2
+ export declare const resolvePresetName: (pluginName: string) => string;
3
+ export declare const api: {
4
+ assertVersion: () => boolean;
5
+ cache: {
6
+ (): undefined;
7
+ forever(): any;
8
+ never(): any;
9
+ using(): any;
10
+ invalidate(): any;
11
+ };
12
+ caller: () => boolean;
13
+ env: () => boolean;
14
+ version: string;
15
+ };
@@ -0,0 +1,34 @@
1
+ export const resolvePluginName = (pluginName) => {
2
+ if (!/babel/.test(pluginName))
3
+ return `babel-plugin-${pluginName}`;
4
+ if (pluginName.startsWith('@babel/')) {
5
+ if (pluginName.startsWith('@babel/plugin'))
6
+ return pluginName;
7
+ const [, name] = pluginName.split('/');
8
+ return `@babel/plugin-${name}`;
9
+ }
10
+ return pluginName;
11
+ };
12
+ export const resolvePresetName = (pluginName) => {
13
+ if (!/babel/.test(pluginName))
14
+ return `babel-preset-${pluginName}`;
15
+ if (pluginName.startsWith('@babel/')) {
16
+ if (pluginName.startsWith('@babel/preset'))
17
+ return pluginName;
18
+ const [, name] = pluginName.split('/');
19
+ return `@babel/preset-${name}`;
20
+ }
21
+ return pluginName;
22
+ };
23
+ const cacheFn = () => void 0;
24
+ cacheFn.forever = () => cacheFn;
25
+ cacheFn.never = () => cacheFn;
26
+ cacheFn.using = () => cacheFn;
27
+ cacheFn.invalidate = () => cacheFn;
28
+ export const api = {
29
+ assertVersion: () => true,
30
+ cache: cacheFn,
31
+ caller: () => true,
32
+ env: () => true,
33
+ version: '0.0.0',
34
+ };
@@ -0,0 +1,8 @@
1
+ import type { BabelConfigObj } from './types.js';
2
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
3
+ export declare const NAME = "Babel";
4
+ export declare const ENABLERS: RegExp[];
5
+ export declare const isEnabled: IsPluginEnabledCallback;
6
+ export declare const CONFIG_FILE_PATTERNS: string[];
7
+ export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
8
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,30 @@
1
+ import { compact } from '../../util/array.js';
2
+ import { timerify } from '../../util/Performance.js';
3
+ import { hasDependency, load } from '../../util/plugin.js';
4
+ import { resolvePresetName, resolvePluginName, api } from './helpers.js';
5
+ export const NAME = 'Babel';
6
+ export const ENABLERS = [/^@babel\//];
7
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
8
+ export const CONFIG_FILE_PATTERNS = [
9
+ 'babel.config.json',
10
+ 'babel.config.js',
11
+ '.babelrc.json',
12
+ '.babelrc.js',
13
+ '.babelrc',
14
+ 'package.json',
15
+ ];
16
+ const getItemName = (value) => typeof value === 'string' ? [value] : Array.isArray(value) ? [value[0]] : [];
17
+ export const getDependenciesFromConfig = (config) => {
18
+ const presets = config.presets?.flatMap(getItemName).map(resolvePresetName) ?? [];
19
+ const plugins = config.plugins?.flatMap(getItemName).map(resolvePluginName) ?? [];
20
+ const nested = config.env ? Object.values(config.env).flatMap(getDependenciesFromConfig) : [];
21
+ return compact([...presets, ...plugins, ...nested]);
22
+ };
23
+ const findBabelDependencies = async (configFilePath, { manifest }) => {
24
+ let config = configFilePath.endsWith('package.json') ? manifest.babel : await load(configFilePath);
25
+ if (typeof config === 'function') {
26
+ config = config(api);
27
+ }
28
+ return config ? getDependenciesFromConfig(config) : [];
29
+ };
30
+ export const findDependencies = timerify(findBabelDependencies);
@@ -0,0 +1,9 @@
1
+ import { api } from './helpers.js';
2
+ type BabelConfigFn = (options: typeof api) => BabelConfigObj;
3
+ export type BabelConfigObj = {
4
+ plugins?: (string | [string, unknown])[];
5
+ presets?: (string | [string, unknown])[];
6
+ env?: Record<string, BabelConfigObj>;
7
+ };
8
+ export type BabelConfig = BabelConfigObj | BabelConfigFn;
9
+ export {};
@@ -0,0 +1 @@
1
+ import { api } from './helpers.js';
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Capacitor";
3
+ export declare const ENABLERS: RegExp[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,11 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Capacitor';
4
+ export const ENABLERS = [/^@capacitor\//];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['capacitor.config.ts'];
7
+ const findCapacitorDependencies = async (configFilePath) => {
8
+ const config = await load(configFilePath);
9
+ return config.includePlugins ?? [];
10
+ };
11
+ export const findDependencies = timerify(findCapacitorDependencies);
@@ -0,0 +1,3 @@
1
+ export type CapacitorConfig = {
2
+ includePlugins?: string[];
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Changesets";
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,15 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Changesets';
4
+ export const ENABLERS = ['@changesets/cli'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['.changeset/config.json'];
7
+ const findChangesetsDependencies = async (configFilePath) => {
8
+ const config = await load(configFilePath);
9
+ return Array.isArray(config.changelog)
10
+ ? [config.changelog[0]]
11
+ : typeof config.changelog === 'string'
12
+ ? [config.changelog]
13
+ : [];
14
+ };
15
+ export const findDependencies = timerify(findChangesetsDependencies);
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Commitizen";
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,14 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Commitizen';
4
+ export const ENABLERS = ['commitizen'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['.czrc', '.cz.json', 'package.json'];
7
+ const findPluginDependencies = async (configFilePath, { manifest }) => {
8
+ const config = configFilePath.endsWith('package.json')
9
+ ? manifest.config?.commitizen
10
+ : await load(configFilePath);
11
+ const path = config?.path;
12
+ return path === undefined ? [] : [path];
13
+ };
14
+ export const findDependencies = timerify(findPluginDependencies);
@@ -0,0 +1,3 @@
1
+ export type PluginConfig = {
2
+ path?: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "commitlint";
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,18 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'commitlint';
4
+ export const ENABLERS = ['@commitlint/cli'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = [
7
+ '.commitlintrc',
8
+ '.commitlintrc.{json,yaml,yml,js,cjs,ts,cts}',
9
+ 'commitlint.config.{js,cjs,ts,cts}',
10
+ 'package.json',
11
+ ];
12
+ const findCommitLintDependencies = async (configFilePath, { manifest }) => {
13
+ const config = configFilePath.endsWith('package.json')
14
+ ? manifest.commitlint
15
+ : await load(configFilePath);
16
+ return config?.extends ? [config.extends].flat() : [];
17
+ };
18
+ export const findDependencies = timerify(findCommitLintDependencies);
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "cspell";
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 = 'cspell';
4
+ export const ENABLERS = ['cspell'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = [
7
+ 'cspell.config.{js,cjs,json,yaml,yml}',
8
+ 'cspell.{json,yaml,yml}',
9
+ '.c{s,S}pell.json',
10
+ 'cSpell.json',
11
+ ];
12
+ const findCspellDependencies = async (configFilePath) => {
13
+ const config = await load(configFilePath);
14
+ const imports = config?.import ?? [];
15
+ return imports;
16
+ };
17
+ export const findDependencies = timerify(findCspellDependencies);
@@ -0,0 +1,3 @@
1
+ export type PluginConfig = {
2
+ import?: string[];
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { IsPluginEnabledCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Cypress";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const ENTRY_FILE_PATTERNS: string[];
@@ -0,0 +1,10 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ export const NAME = 'Cypress';
3
+ export const ENABLERS = ['cypress'];
4
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
5
+ export const ENTRY_FILE_PATTERNS = [
6
+ 'cypress.config.{js,ts,mjs,cjs}',
7
+ 'cypress/support/e2e.{js,jsx,ts,tsx}',
8
+ 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
9
+ 'cypress/plugins/index.js',
10
+ ];
@@ -0,0 +1 @@
1
+ export declare const fallback: (configFilePath: string) => any;
@@ -0,0 +1,13 @@
1
+ import createJITI from 'jiti';
2
+ import transform from 'jiti/dist/babel.js';
3
+ import { timerify } from '../../util/Performance.js';
4
+ const rushstackMatch = /require\(("|')@rushstack\/(eslint-config\/patch|eslint-patch)\/modern-module-resolution("|')\)/;
5
+ const jiti = createJITI(process.cwd(), {
6
+ cache: false,
7
+ transform: (opts) => {
8
+ opts.source = opts.source.replace(rushstackMatch, '');
9
+ return transform(opts);
10
+ },
11
+ });
12
+ const load = (configFilePath) => jiti(configFilePath);
13
+ export const fallback = timerify(load);
@@ -0,0 +1,14 @@
1
+ /// <reference types="npmcli__package-json" />
2
+ import type { ESLintConfig } from './types.js';
3
+ import type { PackageJson } from '@npmcli/package-json';
4
+ type Manifest = PackageJson & {
5
+ eslintConfig?: ESLintConfig;
6
+ };
7
+ type GetDependenciesDeep = (configFilePath: string, dependencies: Set<string>, options: {
8
+ cwd: string;
9
+ manifest: Manifest;
10
+ }) => Promise<Set<string>>;
11
+ export declare const getDependenciesDeep: GetDependenciesDeep;
12
+ export declare const resolvePluginSpecifier: (specifier: string) => string;
13
+ export declare const resolveExtendSpecifier: (specifier: string) => string | undefined;
14
+ export {};
@@ -0,0 +1,83 @@
1
+ import { compact } from '../../util/array.js';
2
+ import { isInternal, dirname, toAbsolute } from '../../util/path.js';
3
+ import { load } from '../../util/plugin.js';
4
+ import { _resolve } from '../../util/require.js';
5
+ import { fallback } from './fallback.js';
6
+ const getDependencies = (config) => {
7
+ const extendsSpecifiers = config.extends ? [config.extends].flat().map(resolveExtendSpecifier) : [];
8
+ if (extendsSpecifiers.some(specifier => specifier?.startsWith('eslint-plugin-prettier')))
9
+ extendsSpecifiers.push('eslint-config-prettier');
10
+ const plugins = config.plugins ? config.plugins.map(resolvePluginSpecifier) : [];
11
+ const parser = config.parser;
12
+ const extraPlugins = config.parserOptions?.babelOptions?.plugins ?? [];
13
+ const extraParsers = config.parserOptions?.babelOptions?.presets ?? [];
14
+ const settings = config.settings ? getDependenciesFromSettings(config.settings) : [];
15
+ const overrides = config.overrides ? [config.overrides].flat().flatMap(getDependencies) : [];
16
+ return compact([
17
+ ...extendsSpecifiers,
18
+ ...plugins,
19
+ ...extraPlugins,
20
+ parser,
21
+ ...extraParsers,
22
+ ...settings,
23
+ ...overrides,
24
+ ]);
25
+ };
26
+ export const getDependenciesDeep = async (configFilePath, dependencies = new Set(), options) => {
27
+ const addAll = (deps) => deps.forEach(dependency => dependencies.add(dependency));
28
+ const config = configFilePath.endsWith('package.json')
29
+ ? options.manifest.eslintConfig
30
+ : /(\.(jsonc?|ya?ml)|rc)$/.test(configFilePath)
31
+ ? await load(configFilePath)
32
+ : await fallback(configFilePath);
33
+ if (config) {
34
+ if (config.extends) {
35
+ for (const extend of [config.extends].flat()) {
36
+ if (isInternal(extend)) {
37
+ const filePath = toAbsolute(extend, dirname(configFilePath));
38
+ const extendConfigFilePath = _resolve(filePath);
39
+ dependencies.add(extendConfigFilePath);
40
+ addAll(await getDependenciesDeep(extendConfigFilePath, dependencies, options));
41
+ }
42
+ }
43
+ }
44
+ addAll(getDependencies(config));
45
+ }
46
+ return dependencies;
47
+ };
48
+ const isQualifiedSpecifier = (specifier) => specifier === 'eslint' ||
49
+ /\/eslint-(config|plugin)$/.test(specifier) ||
50
+ /.+eslint-(config|plugin)\//.test(specifier) ||
51
+ /eslint-(config|plugin)-/.test(specifier);
52
+ const resolveSpecifier = (namespace, rawSpecifier) => {
53
+ const specifier = rawSpecifier.replace(/(^plugin:|:.+$)/, '');
54
+ if (isQualifiedSpecifier(specifier))
55
+ return specifier;
56
+ if (!specifier.startsWith('@'))
57
+ return `${namespace}-${specifier}`;
58
+ const [scope, name, ...rest] = specifier.split('/');
59
+ if (rawSpecifier.startsWith('plugin:') && rest.length === 0)
60
+ return [scope, namespace, name].join('/');
61
+ return [scope, name ? `${namespace}-${name}` : namespace, ...rest].join('/');
62
+ };
63
+ export const resolvePluginSpecifier = (specifier) => resolveSpecifier('eslint-plugin', specifier);
64
+ export const resolveExtendSpecifier = (specifier) => {
65
+ if (isInternal(specifier))
66
+ return;
67
+ if (/^next(\/.+)?$/.test(specifier))
68
+ return specifier;
69
+ const namespace = specifier.startsWith('plugin:') ? 'eslint-plugin' : 'eslint-config';
70
+ return resolveSpecifier(namespace, specifier);
71
+ };
72
+ const getDependenciesFromSettings = (settings = {}) => {
73
+ return compact(Object.entries(settings).flatMap(([settingKey, settings]) => {
74
+ if (settingKey === 'import/resolver') {
75
+ return (typeof settings === 'string' ? [settings] : Object.keys(settings))
76
+ .filter(key => key !== 'node')
77
+ .map(key => `eslint-import-resolver-${key}`);
78
+ }
79
+ if (settingKey === 'import/parsers') {
80
+ return typeof settings === 'string' ? [settings] : Object.keys(settings);
81
+ }
82
+ }));
83
+ };
@@ -0,0 +1,7 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "ESLint";
3
+ export declare const ENABLERS: string[];
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 findDependencies: GenericPluginCallback;
@@ -0,0 +1,15 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
+ import { getDependenciesDeep } from './helpers.js';
4
+ export const NAME = 'ESLint';
5
+ export const ENABLERS = ['eslint'];
6
+ export const isEnabled = ({ dependencies, manifest, config }) => hasDependency(dependencies, ENABLERS) ||
7
+ 'eslint' in config ||
8
+ Boolean(manifest.name && /(^eslint-config|\/eslint-config)/.test(manifest.name));
9
+ export const CONFIG_FILE_PATTERNS = ['.eslintrc', '.eslintrc.{js,json,cjs}', '.eslintrc.{yml,yaml}', 'package.json'];
10
+ export const ENTRY_FILE_PATTERNS = ['eslint.config.js'];
11
+ const findESLintDependencies = async (configFilePath, { cwd, manifest }) => {
12
+ const dependencies = await getDependenciesDeep(configFilePath, new Set(), { cwd, manifest });
13
+ return Array.from(dependencies);
14
+ };
15
+ export const findDependencies = timerify(findESLintDependencies);
@@ -0,0 +1,27 @@
1
+ type ParserOptions = {
2
+ project?: string;
3
+ babelOptions?: {
4
+ plugins: string[];
5
+ presets: string[];
6
+ };
7
+ };
8
+ type Settings = Record<string, Record<string, unknown> | string>;
9
+ type Rules = Record<string, string | number>;
10
+ type BaseConfig = {
11
+ extends?: string | string[];
12
+ parser?: string;
13
+ parserOptions?: ParserOptions;
14
+ processor?: string;
15
+ plugins?: string[];
16
+ settings?: Settings;
17
+ rules?: Rules;
18
+ };
19
+ export type OverrideConfig = BaseConfig & {
20
+ files: string[];
21
+ overrides: OverrideConfig;
22
+ };
23
+ export type ESLintConfig = BaseConfig & {
24
+ env?: Record<string, boolean>;
25
+ overrides?: OverrideConfig[];
26
+ };
27
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "Gatsby";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const PRODUCTION_ENTRY_FILE_PATTERNS: string[];
7
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,30 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ export const NAME = 'Gatsby';
4
+ export const ENABLERS = ['gatsby', 'gatsby-cli'];
5
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
6
+ export const CONFIG_FILE_PATTERNS = ['gatsby-{config,node}.{js,jsx,ts,tsx}'];
7
+ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
8
+ 'gatsby-{browser,ssr}.{js,jsx,ts,tsx}',
9
+ 'src/api/**/*.{js,ts}',
10
+ 'src/pages/**/*.{js,jsx,ts,tsx}',
11
+ 'src/templates/**/*.{js,jsx,ts,tsx}',
12
+ 'src/html.{js,jsx,ts,tsx}',
13
+ ];
14
+ const findGatsbyDependencies = async (configFilePath) => {
15
+ const config = await load(configFilePath);
16
+ if (/gatsby-config/.test(configFilePath)) {
17
+ return config.plugins.map(plugin => (typeof plugin === 'string' ? plugin : plugin.resolve));
18
+ }
19
+ if (/gatsby-node/.test(configFilePath)) {
20
+ const plugins = new Set();
21
+ const actions = { setBabelPlugin: plugin => plugins.add(plugin.name) };
22
+ const _config = config;
23
+ if (typeof _config.onCreateBabelConfig === 'function') {
24
+ _config.onCreateBabelConfig({ actions });
25
+ }
26
+ return Array.from(plugins);
27
+ }
28
+ return [];
29
+ };
30
+ export const findDependencies = timerify(findGatsbyDependencies);
@@ -0,0 +1,15 @@
1
+ export type GatsbyConfig = {
2
+ plugins: (string | {
3
+ resolve: string;
4
+ })[];
5
+ };
6
+ export type GatsbyActions = {
7
+ actions: {
8
+ setBabelPlugin: ({ name }: {
9
+ name: string;
10
+ }) => void;
11
+ };
12
+ };
13
+ export type GatsbyNode = {
14
+ onCreateBabelConfig: (options: GatsbyActions) => void;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "GitHub Actions";
3
+ export declare const ENABLERS = "This plugin is enabled when a `.yml` file is found in the `.github/workflows` folder.";
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,21 @@
1
+ import { _getDependenciesFromScripts } from '../../binaries/index.js';
2
+ import { _firstGlob } from '../../util/glob.js';
3
+ import { getValuesByKeyDeep } from '../../util/object.js';
4
+ import { timerify } from '../../util/Performance.js';
5
+ import { load } from '../../util/plugin.js';
6
+ export const NAME = 'GitHub Actions';
7
+ export const ENABLERS = 'This plugin is enabled when a `.yml` file is found in the `.github/workflows` folder.';
8
+ export const isEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: ['.github/workflows/*.yml'] }));
9
+ export const CONFIG_FILE_PATTERNS = ['.github/workflows/*.yml', '.github/**/action.{yml,yaml}'];
10
+ const findGithubActionsDependencies = async (configFilePath, { cwd, manifest }) => {
11
+ const config = await load(configFilePath);
12
+ if (!config)
13
+ return [];
14
+ const scripts = getValuesByKeyDeep(config, 'run').filter((value) => typeof value === 'string');
15
+ return _getDependenciesFromScripts(scripts, {
16
+ cwd,
17
+ manifest,
18
+ knownGlobalsOnly: true,
19
+ });
20
+ };
21
+ export const findDependencies = timerify(findGithubActionsDependencies);
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "husky";
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,19 @@
1
+ import { readFileSync } from 'fs';
2
+ import { _getDependenciesFromScripts } from '../../binaries/index.js';
3
+ import { getGitHookPaths } from '../../util/git.js';
4
+ import { timerify } from '../../util/Performance.js';
5
+ import { hasDependency } from '../../util/plugin.js';
6
+ export const NAME = 'husky';
7
+ export const ENABLERS = ['husky'];
8
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
9
+ const gitHookPaths = getGitHookPaths('.husky');
10
+ export const CONFIG_FILE_PATTERNS = [...gitHookPaths];
11
+ const findHuskyDependencies = async (configFilePath, { cwd, manifest }) => {
12
+ const script = readFileSync(configFilePath);
13
+ return _getDependenciesFromScripts(String(script), {
14
+ cwd,
15
+ manifest,
16
+ knownGlobalsOnly: true,
17
+ });
18
+ };
19
+ export const findDependencies = timerify(findHuskyDependencies);