chore: add constraint for duplicate dependency declarations (#13744)

This commit is contained in:
Kristoffer K 2021-09-10 09:08:01 +02:00 committed by GitHub
parent 37e1b91b74
commit 0ca601a86f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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').