MCPcopy
hub / github.com/redwoodjs/graphql / enforceNotProdAndDevDependencies

Function enforceNotProdAndDevDependencies

yarn.config.cjs:66–85  ·  view source on GitHub ↗

* This rule will enforce that a dependency doesn't appear in both `dependencies` * and `devDependencies`. * * @param {Context} context

({ Yarn })

Source from the content-addressed store, hash-verified

64 * @param {Context} context
65 */
66function enforceNotProdAndDevDependencies({ Yarn }) {
67 for (const workspace of Yarn.workspaces()) {
68 const dependencies = Yarn.dependencies({ workspace, type: 'dependencies' })
69 const devDependencies = Yarn.dependencies({
70 workspace,
71 type: 'devDependencies',
72 })
73 for (const dependency of dependencies) {
74 if (
75 devDependencies.find(
76 (devDependency) => devDependency.ident === dependency.ident,
77 )
78 ) {
79 dependency.error(
80 `The dependency '${dependency.ident}' should not appear in both dependencies and devDependencies`,
81 )
82 }
83 }
84 }
85}
86
87/**
88 * This rule will enforce that any package built with babel (identified by the

Callers 1

yarn.config.cjsFile · 0.85

Calls 2

findMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected