ES2015 block scoping transform · Babel


#1

Compile ES2015 block scoping (const and let) to ES5

Add the following line to your .babelrc file:


This is a companion discussion topic for the original entry at https://babeljs.io/docs/plugins/transform-es2015-block-scoping/

#2

Should this plugin check for the following incorrect code?:

const getHash = () => ()
const state = { type: "transient", hash: getHash(state) }

State is used before it is defined.