Skip to content

Commit

Permalink
[Refactor] add explicit support for RestElement alongside Experimenta…
Browse files Browse the repository at this point in the history
…lRestProperty
  • Loading branch information
ljharb committed Jun 25, 2018
1 parent c34f14f commit 3b04d5f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/rules/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
return
}

for (let specifier of declaration.specifiers) {
for (const specifier of declaration.specifiers) {
switch (specifier.type) {
case 'ImportNamespaceSpecifier':
if (!imports.size) {
Expand Down Expand Up @@ -160,8 +160,12 @@ module.exports = {

if (pattern.type !== 'ObjectPattern') return

for (let property of pattern.properties) {
if (property.type === 'ExperimentalRestProperty' || !property.key) {
for (const property of pattern.properties) {
if (
property.type === 'ExperimentalRestProperty'
|| property.type === 'RestElement'
|| !property.key
) {
continue
}

Expand Down

0 comments on commit 3b04d5f

Please sign in to comment.