Skip to content

Add no-param-reassign from eslint #3089

Merged
khassel merged 15 commits intoMagicMirrorOrg:developfrom
rejas:cleanup/no-param-reassign
Apr 16, 2023
Merged

Add no-param-reassign from eslint #3089
khassel merged 15 commits intoMagicMirrorOrg:developfrom
rejas:cleanup/no-param-reassign

Conversation

@rejas
Copy link
Collaborator

@rejas rejas commented Apr 9, 2023

While waiting for the easterbunny I cleaned up some bad coding practice :-)

Very open for comments especially regarding the places I commented myself...

js/app.js Outdated
modules.forEach((module) => {
loadModule(module);
});
Log.log("All module helpers loaded.");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greatly simplified this, it shouldnt break exisiting module loading at least for me.

Log.error("Parameter mismatch in module.hide: callback is not an optional parameter!");
usedOptions = callback;
usedCallback = function () {};
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea why this was handled this way from the beginning by @MichMich

callback was never optional, but now some modules might be relying on this function call the way it is. Thats why I added an error warning here so that it might help people write better modules ...

callback = function () {};
Log.error("Parameter mismatch in module.show: callback is not an optional parameter!");
usedOptions = callback;
usedCallback = function () {};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing as in hide module...

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2023

Codecov Report

Merging #3089 (cc5a87f) into develop (4e33690) will decrease coverage by 0.01%.
The diff coverage is 31.18%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           develop    #3089      +/-   ##
===========================================
- Coverage    25.98%   25.98%   -0.01%     
===========================================
  Files           53       53              
  Lines        11583    11572      -11     
===========================================
- Hits          3010     3007       -3     
+ Misses        8573     8565       -8     
Impacted Files Coverage Δ
js/electron.js 0.00% <0.00%> (ø)
js/main.js 0.00% <0.00%> (ø)
js/socketclient.js 0.00% <0.00%> (ø)
modules/default/calendar/calendarfetcherutils.js 66.28% <0.00%> (+0.21%) ⬆️
modules/default/utils.js 49.16% <0.00%> (-0.56%) ⬇️
modules/default/weather/providers/yr.js 0.00% <0.00%> (ø)
modules/default/weather/weather.js 0.00% <0.00%> (ø)
modules/default/weather/weatherprovider.js 0.00% <0.00%> (ø)
js/module.js 69.67% <5.88%> (-0.27%) ⬇️
modules/default/newsfeed/newsfeedfetcher.js 82.70% <33.33%> (+0.09%) ⬆️
... and 4 more

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rejas rejas force-pushed the cleanup/no-param-reassign branch from 21cc32d to 2722047 Compare April 9, 2023 20:34
Copy link
Collaborator

@KristjanESPERANTO KristjanESPERANTO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! It looks good to me. The modules I use also work.

@rejas rejas marked this pull request as ready for review April 16, 2023 15:18
@rejas
Copy link
Collaborator Author

rejas commented Apr 16, 2023

ready for review :-)

@rejas rejas force-pushed the cleanup/no-param-reassign branch from c5ed435 to cc5a87f Compare April 16, 2023 15:24
@khassel khassel merged commit 7e58b38 into MagicMirrorOrg:develop Apr 16, 2023
@rejas rejas deleted the cleanup/no-param-reassign branch April 16, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants