Summary
Skip files that are highly unlikely to contain relevant imports when scanning dependent projects during a move.
Proposed Solution
function shouldCheckFileForImports(filePath: string): boolean {
if (filePath.includes('.spec.') || filePath.includes('.test.')) {
return false;
}
if (filePath.endsWith('.d.ts')) {
return false;
}
if (filePath.includes('/test/') || filePath.includes('/__tests__/')) {
return false;
}
return true;
}
function getProjectSourceFiles(tree: Tree, projectRoot: string): string[] {
// ... existing code ...
visitNotIgnoredFiles(tree, projectRoot, (filePath) => {
if (sourceFileExtensions.some((ext) => filePath.endsWith(ext))) {
if (shouldCheckFileForImports(filePath)) {
sourceFiles.push(normalizePath(filePath));
}
}
});
}
- Introduce heuristics to filter out test/type files from import analysis.
- Make heuristics configurable for edge cases.
Tasks
Definition of Done
Summary
Skip files that are highly unlikely to contain relevant imports when scanning dependent projects during a move.
Proposed Solution
Tasks
.spec.ts,.test.ts,.d.ts,/__tests__/paths) when collecting source files for import analysisDefinition of Done