Skip to content

Commit

Permalink
fix: only remove username properties after flags and imports are created
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Feb 24, 2023
1 parent 4c3ba46 commit d0f65db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rules/migration/no-username-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export const noUsernameProperties = ESLintUtils.RuleCreator.withoutDocs({
});
}

if (source.getText(importDeclaration).includes(mappedMetadata.flag)) {
if (
source.getText(importDeclaration).includes(mappedMetadata.flag) &&
source.getText(flagsProperty).includes(mappedMetadata.flag)
) {
// remove the property only after the other two fixes have been applied
context.report({
node,
Expand Down

0 comments on commit d0f65db

Please sign in to comment.