From 61a60c04a6cb100cc5dcbe85aa10c724a77016d3 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 22 Feb 2018 19:27:25 +0000 Subject: [PATCH] Webpack uses eslint on compile --- services/web/webpack.config.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index b9474cffac..3f7c199b07 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -31,10 +31,16 @@ module.exports = { // Define how file types are handled by webpack module: { rules: [{ - // Pass application JS files through babel-loader, compiling to ES5 - test: /\.js$/, // Only compile .js files + // Ensure eslint is run before compilation with babel + enforce: 'pre', + test: /\.js$/, + // Only compile application files (dependencies are in ES5 already) + exclude: /node_modules/, + loader: 'eslint-loader' + }, { + // Pass application JS files through babel-loader, compiling to ES5 + test: /\.js$/, // Only compile application files (dependencies are in ES5 already) - // include: [path.join(__dirname, './public/frontend')], exclude: /node_modules/, use: [{ loader: 'babel-loader',