enable prefer const (#5113)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
export default function ({ types: t }) {
|
||||
function build(node, nodes, scope) {
|
||||
let first = node.specifiers[0];
|
||||
const first = node.specifiers[0];
|
||||
if (!t.isExportNamespaceSpecifier(first) && !t.isExportDefaultSpecifier(first)) return;
|
||||
|
||||
let specifier = node.specifiers.shift();
|
||||
let uid = scope.generateUidIdentifier(specifier.exported.name);
|
||||
const specifier = node.specifiers.shift();
|
||||
const uid = scope.generateUidIdentifier(specifier.exported.name);
|
||||
|
||||
let newSpecifier;
|
||||
if (t.isExportNamespaceSpecifier(specifier)) {
|
||||
@@ -24,8 +24,8 @@ export default function ({ types: t }) {
|
||||
|
||||
visitor: {
|
||||
ExportNamedDeclaration(path) {
|
||||
let { node, scope } = path;
|
||||
let nodes = [];
|
||||
const { node, scope } = path;
|
||||
const nodes = [];
|
||||
build(node, nodes, scope);
|
||||
if (!nodes.length) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user