Closed araujoarthur0 closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
7be9e9a
) 79.89% compared to head (5a3f644
) 79.36%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Related issue
This helps #1037
Context / Background
The new electron 28 changes things by providing main electron imports through JS modules. That means we'll be able to use
import
syntax rather than node'srequire()
, and no longer need theesm
module to use both notations. Therequire()
notation will still be available, making it the best of both worlds for other imports that haven't migrated yet - date-holidays for example.I'm separating a few of the changes that will need to be made for a simpler review. These changes here still work in electron 27 and will clear the field for a larger patch.
What change is being introduced by this PR?
Using the .cjs extension for files that will be using only node modules
Commit: Renaming window-aux and app-config to .cjs
Updating pre-commit script
Script was trying to format deleted files. It also had to be updated to format .cjs and .mjs files Commit: Preparing commit hook to accept mjs and cjs files, avoiding deleted files Commit: Adding all 3 js extensions to eslint target
Cleanups
Commit: Adding 'use strict' to all files Commit: Export section to have commas and be sorted, last line at end
Switching imports to
import
keyword rather thanrequire()
Commit: Updating renderer electron imports Commit: Switching 'fs' import to use import Commit: Switching 'electron-store' import to use import Commit: Switching notification.js to use export Commit: Switching 'path' import to use import Commit: Switching 'electron' to use import
How will this be tested?
Testsuite works fine.