From 6a2e1a58d55b30c6938566e5163bdb9e8cbf6de2 Mon Sep 17 00:00:00 2001 From: Kevin van der Werff Date: Tue, 1 Oct 2019 14:19:28 +0200 Subject: [PATCH] :wrench: ESLint run on save hot reload --- nuxt.config.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nuxt.config.js b/nuxt.config.js index ac9997d..1bb057c 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -32,6 +32,22 @@ export default { routes: resources.map(category => category.slug) }, + /** + * Configure ESLint to run on save with hot reloading + */ + build: { + extend(config, ctx) { + if (ctx.isDev && ctx.isClient) { + config.module.rules.push({ + enforce: 'pre', + test: /\.(js|vue)$/, + loader: 'eslint-loader', + exclude: /(node_modules)/ + }) + } + } + }, + /* ** Customize the progress-bar color */