refactor(core): migrations do not properly handle multiple templates in source file (#29841)
Currently if there are multiple source files within a given TypeScript source file, only the last template in the source file is checked as we store templates in a `Map` with the source file paths as keys. This is problematic as multiple templates can live within the same source file and we therefore accidentally overwrite existing entries in the resolved templates map. PR Close #29841
This commit is contained in:

committed by
Alex Rickabaugh

parent
446e3573e3
commit
b0c1282fbe
@ -33,8 +33,9 @@ export class Rule extends Rules.TypedRule {
|
||||
|
||||
// Analyze each resolved template and print a warning for property writes to
|
||||
// template variables.
|
||||
resolvedTemplates.forEach((template, filePath) => {
|
||||
const nodes = analyzeResolvedTemplate(filePath, template);
|
||||
resolvedTemplates.forEach(template => {
|
||||
const filePath = template.filePath;
|
||||
const nodes = analyzeResolvedTemplate(template);
|
||||
const templateFile =
|
||||
template.inline ? sourceFile : createHtmlSourceFile(filePath, template.content);
|
||||
|
||||
|
Reference in New Issue
Block a user