diff --git a/.eslintrcProd b/.eslintrcProd new file mode 100644 index 0000000..bcadb59 --- /dev/null +++ b/.eslintrcProd @@ -0,0 +1,8 @@ +{ + "extends": [ + "./package.json" + ], + "rules": { + "no-console": ["error"], + } +} diff --git a/package.json b/package.json index 65b3251..8eb555b 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ ] }, "rules": { + "no-console": ["off"], "comma-dangle": [ "error", { diff --git a/resources/assets/build/config.js b/resources/assets/build/config.js index 60b8098..26a3812 100644 --- a/resources/assets/build/config.js +++ b/resources/assets/build/config.js @@ -20,6 +20,7 @@ const config = merge({ root: rootPath, assets: path.join(rootPath, 'resources/assets'), dist: path.join(rootPath, 'dist'), + eslintProd: path.join(rootPath, '.eslintrcProd'), }, enabled: { sourceMaps: !isProduction, diff --git a/resources/assets/build/webpack.config.js b/resources/assets/build/webpack.config.js index d6450bb..fc71a38 100644 --- a/resources/assets/build/webpack.config.js +++ b/resources/assets/build/webpack.config.js @@ -41,7 +41,10 @@ let webpackConfig = { enforce: 'pre', test: /\.js$/, include: config.paths.assets, - use: 'eslint', + loader: 'eslint-loader', + options: { + configFile: config.env.production ? config.paths.eslintProd : null, + }, }, { enforce: 'pre',