wrong no-let behavior
Closed this issue · 3 comments
budarin commented
let config = {};
try {
config = JSON.parse(fs.readFileSync('./.babelrc'));
} catch (err) {
console.error('==> ERROR: Error parsing your .babelrc.');
console.error(err);
}
require('babel-register')(config);
error - unexpected let
ljharb commented
This is indeed supposed to be an error - the rule forbids all usage of let
.
lazyeasydev commented
const config = (() => {
try {
return JSON.parse(fs.readFileSync('./.babelrc'));
} catch (err) {
console.error('==> ERROR: Error parsing your .babelrc.');
console.error(err);
}
})()
require('babel-register')(config);
You can do it like this instead @budarin
budarin commented
Thanks!