forge icon indicating copy to clipboard operation
forge copied to clipboard

eslint-plugin-webpack does not lint the main process on `electron-forge start` but does on `electron-forge make`

Open JordanDC2 opened this issue 2 years ago • 0 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.0-beta.58

Electron version

17.2.0

Operating system

macOS 12.5

Last known working Electron Forge version

No response

Expected behavior

Consistent inability to compile the main process between electron-forge start and electron-forge make in the presence of linting errors.

Actual behavior

I'm using eslint-webpack-plugin (https://webpack.js.org/plugins/eslint-webpack-plugin/) in an electron project that uses forge and forge's webpack plugin. I have both a webpack.main.config.js and a webpack.renderer.config.js that use the following code:

const ESLintPlugin = require("eslint-webpack-plugin");

const plugins = [
    new ESLintPlugin({ extensions: [ "ts", "tsx" ] })
];


module.exports = {
    entry: "./src/Electron/index.ts",
    devtool: "source-map",
    module: {
        rules: require("./webpack.rules"),
    },
    resolve: {
        extensions: [ ".js", ".ts", ".jsx", ".tsx", ".css", ".json" ],
        plugins: [
            new TsconfigPathsPlugin()
        ]
    },
    externals: {
    },
    plugins
};

Now the interesting thing is that the renderer process lints everything perfectly, but the main process is not linted when the app is run, however when i run electron-forge make all of the main process typescript errors get thrown at me

So basically, forge does not appear to output the linting errors on electron-forge start but does on electron-forge make

Steps to reproduce

  1. use eslint-webpack-plugin alongside the forge webpack plugin
  2. write code with a linting error in the main process
  3. run electron-forge start: makes it past the main process compliation and the project runs just fine
  4. run electron-forge make: errors out on the main process compilation

Additional information

No response

JordanDC2 avatar Aug 29 '22 14:08 JordanDC2