diff --git a/src/rules/no-mutable-exports.js b/src/rules/no-mutable-exports.js index ba403d715..e6173bf11 100644 --- a/src/rules/no-mutable-exports.js +++ b/src/rules/no-mutable-exports.js @@ -31,7 +31,7 @@ module.exports = function (context) { if (node.declaration) { checkDeclaration(node.declaration) - } else { + } else if (!node.source) { for (let specifier of node.specifiers) { checkDeclarationsInScope(scope, specifier.local.name) } diff --git a/tests/src/rules/no-mutable-exports.js b/tests/src/rules/no-mutable-exports.js index 14f1ef7c7..d3874b797 100644 --- a/tests/src/rules/no-mutable-exports.js +++ b/tests/src/rules/no-mutable-exports.js @@ -24,6 +24,10 @@ ruleTester.run('no-mutable-exports', rule, { test({ code: 'class Counter {}\nexport { Counter as Count }'}), test({ code: 'class Counter {}\nexport default Counter'}), test({ code: 'class Counter {}\nexport { Counter as default }'}), + test({ + parser: 'babel-eslint', + code: 'export Something from "./something";', + }), ], invalid: [ test({