Files
babel/packages/babel-plugin-transform-reserved-words/src/index.js

12 lines
254 B
JavaScript

export default function({ types: t }) {
return {
visitor: {
"BindingIdentifier|ReferencedIdentifier"(path) {
if (!t.isValidES3Identifier(path.node.name)) {
path.scope.rename(path.node.name);
}
},
},
};
}