electron / electron/forge

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

Open
#2,928 0 comments 1 reaction 0 assignees View on GitHub
plugin/webpack
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron-userland/electron-forge/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.