Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint-loader to the custom storybook webpack configuration #2446

Closed
dcorb opened this issue Dec 7, 2017 · 2 comments
Closed

Add eslint-loader to the custom storybook webpack configuration #2446

dcorb opened this issue Dec 7, 2017 · 2 comments

Comments

@dcorb
Copy link

dcorb commented Dec 7, 2017

Issue details

Adding eslint-loader to story webpack config doens't seem to work

Steps to reproduce

I have this in webpack.config.js:
after reading this documentation piece https://github.com/storybooks/storybook/blob/master/app/react/src/server/config/defaults/webpack.config.js

I can't get eslint to output any type of messages, I have a .eslintrc file in the root folder, and I have tried many different combinations of eslint options, loading as "pre", etc, etc.. also in Full control mode. No luck

const path = require('path');
module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        loaders: [ {
                loader: 'eslint-loader',
                 options: {
                  emitError: true,
                  failOnError: true
                },
              }],
        include: path.resolve(__dirname, '../src')
      }
    ]
  }
}

I tried also this example of an older issue
without success #90 (comment)

version of Storybook and optionally any affected addons that you're running

 "@storybook/addon-actions": "^3.2.17",
    "@storybook/addon-info": "^3.2.17",
    "@storybook/addon-knobs": "^3.2.17",
    "@storybook/addon-links": "^3.2.17",
    "@storybook/addon-options": "^3.2.17",
    "@storybook/react": "^3.2.17",

"eslint": "^4.12.1",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-react": "^7.5.1",

@Hypnosphi
Copy link
Member

To override loader for js, you need to use Full Control Mode
Don't forget to include babel-loader as well

@dcorb
Copy link
Author

dcorb commented Dec 12, 2017

babel-loader fixed it for me, no need for Full Control it seems.
Thanks Filipp

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

No branches or pull requests

3 participants