Skip to content

Commit fdc1901

Browse files
author
Dima Voytenko
authored
Fixed unused-private-field lint rule to avoid breaking it on additional assignments (ampproject#24641)
1 parent ecebd34 commit fdc1901

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build-system/eslint-rules/unused-private-field.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ module.exports = {
214214

215215
const {name} = node.property;
216216
const {declared} = current();
217-
declared.set(name, node.parent);
217+
if (!declared.has(name)) {
218+
declared.set(name, node.parent);
219+
}
218220
},
219221

220222
'ClassBody MemberExpression': function(node) {

0 commit comments

Comments
 (0)