Skip to content

Commit

Permalink
Add isRootOnly to moonrepo and yarn plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Dec 4, 2024
1 parent 84088d8 commit 9c07294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/knip/src/plugins/moonrepo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const enablers = ['@moonrepo/cli'];

const isEnabled: IsPluginEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);

const config: string[] = ['moon.yml', '.moon/tasks.yml', '.moon/tasks/*.yml'];
const isRootOnly = true;

const config = ['moon.yml', '.moon/tasks.yml', '.moon/tasks/*.yml'];

const resolveConfig: ResolveConfig<MoonConfiguration> = async (config, options) => {
const tasks = config.tasks ? Object.values(config.tasks) : [];
Expand All @@ -27,6 +29,7 @@ export default {
title,
enablers,
isEnabled,
isRootOnly,
config,
resolveConfig,
} satisfies Plugin;
5 changes: 4 additions & 1 deletion packages/knip/src/plugins/yarn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ const enablers = 'This plugin is enabled when a `yarn.lock` file is found in the

const isEnabled: IsPluginEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: ['yarn.lock'] }));

const entry: string[] = ['yarn.config.cjs'];
const isRootOnly = true;

const entry = ['yarn.config.cjs'];

export default {
title,
enablers,
isEnabled,
isRootOnly,
entry,
} satisfies Plugin;

0 comments on commit 9c07294

Please sign in to comment.