We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce1fec7 commit b3ed9d6Copy full SHA for b3ed9d6
lib/rules/no-unused-state.js
@@ -136,7 +136,7 @@ module.exports = {
136
if (prop.type === 'Property') {
137
addUsedStateField(prop.key);
138
} else if (
139
- prop.type === 'ExperimentalRestProperty' &&
+ (prop.type === 'ExperimentalRestProperty' || prop.type === 'RestElement') &&
140
classInfo.aliases
141
) {
142
classInfo.aliases.add(getName(prop.argument));
@@ -378,6 +378,12 @@ module.exports = {
378
if (classInfo && isStateReference(node.argument)) {
379
classInfo = null;
380
}
381
+ },
382
+
383
+ SpreadElement(node) {
384
+ if (classInfo && isStateReference(node.argument)) {
385
+ classInfo = null;
386
+ }
387
388
};
389
})
0 commit comments