Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): undecorated-classes-with-decorated-fields migration commits empty updates #32391

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -65,9 +65,14 @@ function runUndecoratedClassesMigration(tree: Tree, tsconfigPath: string, basePa
file => !file.isDeclarationFile && !program.isSourceFileFromExternalLibrary(file));

sourceFiles.forEach(sourceFile => {
const update = tree.beginUpdate(relative(basePath, sourceFile.fileName));
const classes = getUndecoratedClassesWithDecoratedFields(sourceFile, typeChecker);

if (classes.length === 0) {
return;
}

const update = tree.beginUpdate(relative(basePath, sourceFile.fileName));

classes.forEach((current, index) => {
// If it's the first class that we're processing in this file, add `Directive` to the imports.
if (index === 0 && !hasNamedImport(current.importDeclaration, FALLBACK_DECORATOR)) {
Expand Down