Search code examples
javascriptnode.jsstorereduxeslint

ESLint ES6 Redux global-required Unexpected require();


enter image description here

I have this problem with ESLint and can't soulve on my own, those stores are separated for each enviroement as you can see on the screenshot, how could I fix that to make ESLint happy and I to learn a new thing?


Solution

  • It's because you're requiring in branched code: http://eslint.org/docs/rules/global-require.

    If you don't want to change your code, just add disabling comments:

    /* eslint-disable global-require */
    
    // your code here
    
    /* eslint-enable global-require */