forge icon indicating copy to clipboard operation
forge copied to clipboard

eslint not working as expected on Webpack + TypeScript template project

Open guidupuy opened this issue 2 years ago • 3 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.2.1

Electron version

25.3.1

Operating system

macOS Ventura 13.4

Last known working Electron Forge version

No response

Expected behavior

Running npm run lint should output errors such as referring to an undefined variable.

Actual behavior

Nothing gets outputted

Steps to reproduce

Create new electron app using the Webpack + TypeScript template:

npm init electron-app@latest my-new-app -- --template=webpack-typescript

Modify l. 31 in renderer.js to artificially include a reference to an undefined variable:

console.log(`👋 This message is being logged by "renderer.js", included via webpack ${a}`); // a is not defined

Run eslint:

npm run eslint

Additional information

No response

guidupuy avatar Jul 24 '23 09:07 guidupuy

Hi @guidupuy, do you have a more specific repro case? I don't think ESLint comes included when you initialize a new Forge app.

erickzhao avatar Aug 03 '23 22:08 erickzhao

It does if you initialize it with:

npm init electron-app@latest my-new-app -- --template=webpack-typescript

Just tried again a minute ago.

guidupuy avatar Aug 04 '23 07:08 guidupuy

See https://github.com/electron/forge/blob/e7eccc184bd542ced9256af875f51ccc3654196f/packages/template/webpack-typescript/src/WebpackTypeScriptTemplate.ts#L58

guidupuy avatar Aug 04 '23 07:08 guidupuy