fix issues raised by eslint

This commit is contained in:
Sérgio Ramos 2016-10-20 20:46:50 +01:00
parent 06f7b29fc3
commit 7ffaba66a5
3 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@ const Ncp = require('ncp');
const readdir = thenify(fs.readdir);
const writeFile = thenify(fs.writeFile);
const readFile = thenify(fs.readFile);
const ncp = thenify(Ncp.ncp);
const root = path.join(__dirname, '../locales');
@ -27,7 +26,7 @@ const compile = async () => {
const files = await readdir(root);
const jsons = files.filter(filename => path.extname(filename) === '.json');
const locales = files.reduce((res, filename) => {
const locales = jsons.reduce((res, filename) => {
const name = path.parse(filename).name;
const json = JSON.stringify(require(path.join(root, filename)));
const lang = name.split(/\-/)[0];
@ -52,8 +51,6 @@ const compile = async () => {
return ncp(source, destination);
}));
return await Promise.all(Object.keys(locales).map((name) => {
console.log(`Writing ${name}.js`);

View File

@ -25,8 +25,9 @@ module.exports = (({
).toLowerCase();
const lang = detectedLocale.split(/\-/)[0];
const locale = ReactIntlLocaleData[lang] ?
(Locales[detectedLocale] ? detectedLocale : 'en-us') : 'en-us';
const locale = ReactIntlLocaleData[lang]
? (Locales[detectedLocale] ? detectedLocale : 'en-us')
: 'en-us';
return {
locale,

View File

@ -1,4 +1,3 @@
const qs = require('querystring');
const React = require('react');
const ReactIntlRedux = require('react-intl-redux');
const ReactHotLoader = require('react-hot-loader');