forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircular-deps-test.conf.cjs
32 lines (29 loc) · 1 KB
/
circular-deps-test.conf.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
const path = require('path');
module.exports = {
baseDir: '../',
goldenFile: '../goldens/ts-circular-deps.json',
glob: `./**/*.ts`,
// Command that will be displayed if the golden needs to be updated.
approveCommand: 'pnpm ts-circular-deps:approve',
ignoreTypeOnlyChecks: true,
resolveModule,
};
/**
* Custom module resolver that maps specifiers starting with `@angular/` to the
* local packages folder. This ensures that imports using the module name can be
* resolved. Cross entry-point/package circular dependencies are already be detected
* by Bazel, but in rare cases, the module name is used for imports within entry-points.
*/
function resolveModule(specifier) {
if (specifier.startsWith('@angular/')) {
return path.join(__dirname, specifier.slice('@angular/'.length));
}
return null;
}