Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Turn off linting errors in browser console #52

Closed
victorb opened this issue Sep 3, 2015 · 3 comments
Closed

Turn off linting errors in browser console #52

victorb opened this issue Sep 3, 2015 · 3 comments

Comments

@victorb
Copy link

victorb commented Sep 3, 2015

So, usually a coding session of mine looks like the following:

  1. Write the ugliest code + test that can possibly solve your problem
  2. Refactor the functionality and make a proper structure
  3. Lint and fix stylistic issues

However, with the very verbose setting of linting errors in the browser console, it's hiding most of my other debugging output. I've tried to disable the linting in the browser by commenting out the following part in build/webpack/client.js:

  //eslint : {
  //  configFile : paths.project('.eslintrc'),
  //  failOnError : globals.__PROD__
  //}

But still I see the linting warnings/errors (that also sometimes stops me from continuing developing...).

How can I disable this?

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Sep 3, 2015

Hey, so as a temporary fix what you'd want to do is disable the eslint preloader in ~/build/webpack/client.js (and server.js as well if you're using it):

  module : {
    // preLoaders : [
    //   {
    //     test : /\.(js|jsx)$/,
    //     loaders : ['eslint-loader'],
    //     include : paths.project(config.get('dir_src'))
    //   }
    // ],
    loaders : [
      {
        test : /\.(js|jsx)$/,
        include :  paths.project(config.get('dir_src')),
        loaders : ['react-hot', 'babel?optional[]=runtime&stage=0']
      },
      {
        test    : /\.scss$/,
        loader : ExtractTextPlugin.extract('style-loader', [
          'css-loader',
          'autoprefixer?browsers=last 2 version',
          'sass-loader?includePaths[]=' + paths.src('styles')
        ].join('!'))
      }
    ]
  }

I realize that it's not the greatest solution, but that will at least let you develop freely for now. When I get some time I'll take a look at improving the linting so that it's not as intrusive during development, and probably make the default eslint config much more lenient.

@dvdzkwsk
Copy link
Owner

Hey @victorbjelkholm, since I still haven't figured out how to get the lint errors to not show up in the console, I've added a configuration option here 8f8fd5d:

config.set('webpack_lint_in_dev', true);

You can set this to false to disable linting when developing. It will still lint in all other environments, which is useful for validating PR's and whatnot. I know it's not ideal, but it's at least a workaround until I can find some documentation on disabling certain browser output.

@dvdzkwsk
Copy link
Owner

Closing this for now since this option is available and should serve most use cases. I'll continue to explore the possibility of disabling output in the browser console, but I've yet to find any documentation around how to achieve this.

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

2 participants