Skip to content
This repository has been archived by the owner on Dec 15, 2017. It is now read-only.

disable errors in browser #115

Open
danagilliann opened this issue Nov 13, 2017 · 2 comments
Open

disable errors in browser #115

danagilliann opened this issue Nov 13, 2017 · 2 comments

Comments

@danagilliann
Copy link

Hello! Thanks for making this! I noticed that whenever eslint tries to warn or error, the message appears on the console and on the browser. I was wondering if there was a way to prevent it from appearing on the browser. I'm kind of new to React/ES6/Babel so I'm not sure how to go about this.

@micooz
Copy link
Owner

micooz commented Nov 13, 2017

If you think it's annoying, just remove eslint-loader in webpack/common.config.js:

      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: ['babel-loader' /* , 'eslint-loader' */]
      },

However, display eslint errors in development is a good practice, you should try to fix lint errors first.

If you are working on React/ES6/Babel stack, I recommend you to use create-react-app, it has all the stuff for you.

Tips: If you are running production build, eslint errors will not show in browser.

@LinusBorg
Copy link

LinusBorg commented Nov 13, 2017

I solved this in https://github.com/vuejs-templates/webpack like this:

  1. make all eslint-loader errors warnings with emitWarning: true
  2. configured the dev-server overlay to only show errrors
overlay: {
      warnings: false,
      errors: true
    },

That way, you only see real errros in the overlay, while warnings log to the console/terminal only. This allows HMR to update the page even when warnings exist.

I personally think that's a better workflow during development, as warnings are nor something you have to fix immediatly, so I rather stay in the flow and fix them later. The overlay forces me to fix them immediatly, breaking the flow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants