ESLint is not a constructor

10,497

You also need to install eslint >= 7 from npm, if you haven't already:

Share:
10,497

Related videos on Youtube

Javier Guzmán
Author by

Javier Guzmán

Updated on June 04, 2022

Comments

  • Javier Guzmán
    Javier Guzmán almost 2 years

    I have made the porting to eslint-webpack-plugin and I am getting the error "ESLint is not a constructor", the relevant snippet code is:

    const ESLintPlugin = require('eslint-webpack-plugin');
    
      const plugins = [
        new webpack.DefinePlugin(productionEnvironmentVariables),
        new ESLintPlugin({
          overrideConfigFile: path.resolve(configPath, '.eslintrc.json')
        })
      ];
    

    Any idea what is wrong? I have tried also with new ESLintPlugin() and ESLintPlugin({}).

    Webpack version is ^4.44.2 Eslint version is ^6.8.0 eslint-webpack-plugin is ^2.1.0

    Thank you in advance and regards.

    • Guy Incognito
      Guy Incognito over 3 years
      Update ESLint to version 7.