Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Commit

Permalink
feat(eslint): adds option to disable eslint when in development
Browse files Browse the repository at this point in the history
  • Loading branch information
David Zukowski committed Sep 11, 2015
1 parent 77831fc commit 8f8fd5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
23 changes: 16 additions & 7 deletions build/webpack/client.js
Expand Up @@ -37,13 +37,6 @@ const webpackConfig = {
alias : config.get('utils_aliases')
},
module : {
preLoaders : [
{
test : /\.(js|jsx)$/,
loaders : ['eslint-loader'],
include : paths.project(config.get('dir_src'))
}
],
loaders : [
{
test : /\.(js|jsx)$/,
Expand Down Expand Up @@ -110,4 +103,20 @@ if (globals.__PROD__) {
);
}

// ------------------------------------
// Optional Configuration
// ------------------------------------
if (
!globals.__DEV__ ||
(globals.__DEV__ && config.get('webpack_lint_in_dev'))
) {
webpackConfig.module.preLoaders = [
{
test : /\.(js|jsx)$/,
loaders : ['eslint-loader'],
include : paths.project(config.get('dir_src'))
}
];
}

export default webpackConfig;
3 changes: 3 additions & 0 deletions config/index.js
Expand Up @@ -34,6 +34,9 @@ config.set('webpack_public_path',
`http://${config.get('server_host')}:${config.get('webpack_port')}/`
);

// build options
config.set('webpack_lint_in_dev', true);

// ------------------------------------
// Project
// ------------------------------------
Expand Down

0 comments on commit 8f8fd5d

Please sign in to comment.