From d66216f94f7012359976dacf663eee2b86fdba70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Van=20Dal?= Date: Wed, 30 Jan 2019 16:41:06 -0200 Subject: [PATCH] docs: how to ignore svgs for eslint (#34) --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index fe3d19f..eb7ba02 100755 --- a/README.md +++ b/README.md @@ -114,6 +114,27 @@ export default { } ``` +## How to fix Eslint auto lint error +If you turn on Eslint on save by server, you should exclude `.svg` files of `eslint-loader`. + +Example: +```js +// nuxt.config.js +build: { + extend(config, ctx) { + // Run ESLint on save + if (ctx.isDev && ctx.isClient) { + config.module.rules.push({ + enforce: 'pre', + test: /\.(js|vue)$/, + loader: 'eslint-loader', + exclude: /(node_modules)||(.svg$)/ /* <--- here */ + }) + } + } +} +``` + ## Development - Clone this repository