Skip to content

Commit

Permalink
Unify code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard Kyvenko committed Sep 12, 2016
1 parent ed442f1 commit 300abfa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
paths.entry
],
output: {

pathinfo: true,

// The build folder.
Expand Down Expand Up @@ -60,4 +60,4 @@ module.exports = {
}),
new webpack.HotModuleReplacementPlugin()
]
};
};
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (pathExists.sync('elm-package.json') === false) {
console.log('\nStarting production build...\n');

// Initialize webpack, using the long way: http://webpack.github.io/docs/node.js-api.html#the-long-way
webpack(config).run(function (err, stats) {
webpack(config).run((err, stats) => {

if (err !== null) {
console.log(chalk.red(err));
Expand Down
2 changes: 1 addition & 1 deletion scripts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ function createElmApp (name) {
spawnSync(executablePaths[ 'elm-package' ], [ 'install', '-y' ], { stdio: 'inherit' });

console.log(chalk.green(`\nProject is successfully created in \`${root}\`.`));
}
}
14 changes: 7 additions & 7 deletions scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function extendOmittingProps(deps, deleteProps = []) {

deps = extend({}, deps);

deleteProps.forEach(function (name) {
deleteProps.forEach(name => {
delete deps[ name ];
});

Expand All @@ -41,7 +41,7 @@ function diffTable (target, mixin, head = [ chalk.grey('Name'), chalk.yellow('Ol
}

function promptYesOrNo () {
return new Promise(function (resolve, reject) {
return new Promise((resolve, reject) => {
let property = {
name: 'answer',
message: chalk.yellow('Would you like to continue? [Y/n]')
Expand All @@ -50,7 +50,7 @@ function promptYesOrNo () {
prompt.start();
prompt.message = '';

prompt.get(property, function (err, result) {
prompt.get(property, (err, result) => {
if (result.answer.search(/^y(es)?$/i) !== -1) {
resolve();
} else {
Expand Down Expand Up @@ -115,7 +115,7 @@ if (pathExists.sync('./package.json') === true) {
let pkgEjected = JSON.parse(readFileSync('./package.json'));

Promise.resolve()
.then(function () {
.then(() => {
if (pkgEjected.hasOwnProperty('devDependencies')) {
let diff = diffTable(pkgEjected.devDependencies, devDependencies);
if (diff.length !== 0) {
Expand All @@ -125,7 +125,7 @@ if (pathExists.sync('./package.json') === true) {
}
}
})
.then(function() {
.then(() => {
if (pkgEjected.hasOwnProperty('scripts') && Object.keys(pkgEjected.scripts).length === 0) {
let diff = diffTable(pkgEjected.scripts, scripts);
if (diff.length !== 0) {
Expand All @@ -135,7 +135,7 @@ if (pathExists.sync('./package.json') === true) {
}
}
})
.then(function () {
.then(() => {
pkgEjected.devDependencies = extend({}, devDependencies, pkgEjected.devDependencies);
pkgEjected.scripts = extend({}, scripts, pkgEjected.scripts);
performEject(pkgEjected);
Expand All @@ -154,4 +154,4 @@ if (pathExists.sync('./package.json') === true) {
scripts: scripts,
devDependencies: devDependencies
});
}
}
6 changes: 3 additions & 3 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ if (pathExists.sync('elm-package.json') === false) {
let compiler = webpack(config);
let port = 3000;

compiler.plugin('invalid', function () {
compiler.plugin('invalid', () => {
clear();
console.log('Compiling...');
});

compiler.plugin('done', function (stats) {
compiler.plugin('done', stats => {
clear();

let hasErrors = stats.hasErrors();
Expand Down Expand Up @@ -61,7 +61,7 @@ const devServer = new WebpackDevServer(compiler, {
});

// Launch WebpackDevServer.
devServer.listen(port, (err) => {
devServer.listen(port, err => {
if (err) {
return console.log(err);
}
Expand Down

0 comments on commit 300abfa

Please sign in to comment.