* This rule will enforce that a dependency doesn't appear in both `dependencies` * and `devDependencies`. * * @param {Context} context
({ Yarn })
| 64 | * @param {Context} context |
| 65 | */ |
| 66 | function 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 |
no test coverage detected