Skip to content

Commit

Permalink
chore: hugely simplify enforceNoDualTypeDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
indietyp committed Dec 2, 2024
1 parent 8fc7d11 commit 59fc763
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,8 @@ function enforceConsistentDependenciesAcrossTheProject({ Yarn }) {
* @param {Context} context - The Yarn constraint context.
*/
function enforceNoDualTypeDependencies({ Yarn }) {
for (const dependency of Yarn.dependencies({ type: "devDependencies" })) {
const devDependency = Yarn.dependency({
workspace: dependency.workspace,
ident: dependency.ident,
type: "dependencies",
});

if (devDependency === null) {
continue;
}

dependency.workspace.unset(`dependency.${dependency.ident}`);
for (const devDependency of Yarn.dependencies({ type: "devDependencies" })) {
devDependency.workspace.unset(`dependency.${devDependency.ident}`);
}
}

Expand Down

0 comments on commit 59fc763

Please sign in to comment.