Skip to content

Commit c40912a

Browse files
jfmengelsbenmosher
authored andcommitted
no-mutable-exports: Handle ES7 export extensions. Fixes #317
1 parent 9998b91 commit c40912a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/rules/no-mutable-exports.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = function (context) {
3131

3232
if (node.declaration) {
3333
checkDeclaration(node.declaration)
34-
} else {
34+
} else if (!node.source) {
3535
for (let specifier of node.specifiers) {
3636
checkDeclarationsInScope(scope, specifier.local.name)
3737
}

tests/src/rules/no-mutable-exports.js

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ ruleTester.run('no-mutable-exports', rule, {
2424
test({ code: 'class Counter {}\nexport { Counter as Count }'}),
2525
test({ code: 'class Counter {}\nexport default Counter'}),
2626
test({ code: 'class Counter {}\nexport { Counter as default }'}),
27+
test({
28+
parser: 'babel-eslint',
29+
code: 'export Something from "./something";',
30+
}),
2731
],
2832
invalid: [
2933
test({

0 commit comments

Comments
 (0)