Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How disable eslint-loader of storybook's webpack?

I would like disable eslint-loader of storybook's webpack, cuz I use other process to validate the code's quality.

I know exists the webpack's config about storybook like code below and maybe I could use some filter on config.rules, but maybe isn't good:

const path = require('path')

module.exports = async ({ config }) => {
  // some modifications

  return config
}

I've trying searching on storybook's docs about this, but didn't find anything about.

like image 404
Fuechter Avatar asked Oct 01 '19 14:10

Fuechter


1 Answers

Solution with plugin instanceof EslintWebpackPlugin didn't help me, but this approach helped:

//.storybook/main.js

module.exports = {
  webpackFinal: config => {
    return {
      ...config,
      plugins: config.plugins.filter(plugin => {
        if (plugin.constructor.name === 'ESLintWebpackPlugin') {
          return false
        }
        return true
      }),
    }
  },
}

P.S. the new version will have a CLI parameter to disable eslint: https://github.com/storybookjs/storybook/pull/13452, 6.2.0-alpha.7 already supports it

like image 183
Pavel Avatar answered Sep 19 '22 00:09

Pavel