From 0ca601a86f9c3bf041bf6897d61324ddcc9553aa Mon Sep 17 00:00:00 2001 From: Kristoffer K Date: Fri, 10 Sep 2021 09:08:01 +0200 Subject: [PATCH] chore: add constraint for duplicate dependency declarations (#13744) --- constraints.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/constraints.pro b/constraints.pro index 8beae223e6..bf68e9d7fc 100644 --- a/constraints.pro +++ b/constraints.pro @@ -67,3 +67,8 @@ gen_enforced_field(WorkspaceCwd, FieldName, ExpectedValue) :- \+ atom_concat('./', _, CurrentValue), % Store './' + CurrentValue in ExpectedValue atom_concat('./', CurrentValue, ExpectedValue). + +% Enforces that a dependency doesn't appear in both `dependencies` and `devDependencies` +gen_enforced_dependency(WorkspaceCwd, DependencyIdent, null, 'devDependencies') :- + workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'devDependencies'), + workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'dependencies').