Skip to content

Commit 3603428

Browse files
committed
[Refactor] export: clean up rule, tests
1 parent ade33a4 commit 3603428

File tree

2 files changed

+118
-79
lines changed

2 files changed

+118
-79
lines changed

Diff for: src/rules/export.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,19 @@ module.exports = {
131131
}
132132

133133
return {
134-
'ExportDefaultDeclaration': (node) => addNamed('default', node, getParent(node)),
134+
ExportDefaultDeclaration(node) {
135+
addNamed('default', node, getParent(node));
136+
},
135137

136-
'ExportSpecifier': (node) => addNamed(
137-
node.exported.name || node.exported.value,
138-
node.exported,
139-
getParent(node.parent),
140-
),
138+
ExportSpecifier(node) {
139+
addNamed(
140+
node.exported.name || node.exported.value,
141+
node.exported,
142+
getParent(node.parent),
143+
);
144+
},
141145

142-
'ExportNamedDeclaration': function (node) {
146+
ExportNamedDeclaration(node) {
143147
if (node.declaration == null) return;
144148

145149
const parent = getParent(node);
@@ -165,7 +169,7 @@ module.exports = {
165169
}
166170
},
167171

168-
'ExportAllDeclaration': function (node) {
172+
ExportAllDeclaration(node) {
169173
if (node.source == null) return; // not sure if this is ever true
170174

171175
// `export * as X from 'path'` does not conflict

0 commit comments

Comments
 (0)