Skip to content

chore: upgrade ESLint to v10 and fix newly surfaced issues#4057

Merged
rejas merged 4 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:eslint
Mar 12, 2026
Merged

chore: upgrade ESLint to v10 and fix newly surfaced issues#4057
rejas merged 4 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:eslint

Conversation

@KristjanESPERANTO
Copy link
Collaborator

eslint-plugin-import-x was the last thing blocking the ESLint v10 upgrade - it just got v10 support. So here we go.

The upgrade itself is tiny. The rest of the diff is cleanup from issues ESLint v10 now catches: a few let declarations with initial values that were immediately overwritten anyway (no-useless-assignment), and Translator listed in /* global */ in main.js and module.js.

Working through those no-useless-assignment warnings also surfaced a dead default in openmeteo: maxEntries: 5 in the constructor, which was never actually doing anything - openmeteo never reads this.config.maxEntries anywhere. And weather.js already sets that default for all providers, so it was just a redundant duplicate. Removed that too.

No runtime behavior changes.

Remove useless initial values from several `let` declarations across
weather providers, http_fetcher and weatherutils, and move
maxEntries/maxEntriesLimit into the if-block where they're actually
used. Also drop `Translator` from the `/* global */` comments in
main.js and module.js since ESLint already treats it as a built-in.
openmeteo never reads this.config.maxEntries anywhere. The default
is already set in weather.js for all providers, so the one in the
openmeteo constructor was just a duplicate.
@rejas rejas merged commit 3ea3f0a into MagicMirrorOrg:develop Mar 12, 2026
9 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the eslint branch March 12, 2026 11:21
@khassel
Copy link
Collaborator

khassel commented Mar 12, 2026

We have a problem introduced with this PR or #4056

Tested a fresh install of develop inside a node container:

docker run --rm -it node:25-alpine sh
cd
apk add git
git clone -b develop https://github.com/MagicMirrorOrg/MagicMirror.git
cd MagicMirror/
node --run install-mm
node --run server
node:internal/modules/cjs/loader:1478
  throw err;
  ^

Error: Cannot find module 'globals'
Require stack:
- /root/MagicMirror/js/utils.js
- /root/MagicMirror/js/app.js
- /root/MagicMirror/serveronly/index.js
    at Module.<anonymous> (node:internal/modules/cjs/loader:1475:15)
    at Module._resolveFilename (/root/MagicMirror/js/alias-resolver.js:28:30)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1048:27)
    at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1072:10)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1093:12)
    at Module._load (node:internal/modules/cjs/loader:1261:25)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.require (node:internal/modules/cjs/loader:1575:12)
    at require (node:internal/modules/helpers:191:16)
    at Object.<anonymous> (/root/MagicMirror/js/utils.js:12:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/MagicMirror/js/utils.js',
    '/root/MagicMirror/js/app.js',
    '/root/MagicMirror/serveronly/index.js'
  ]
}

Node.js v25.8.1

If I run npm i then node --run server works.

Any idea to this @KristjanESPERANTO ?

@KristjanESPERANTO
Copy link
Collaborator Author

Try 'npm Install globals'. I'm not at my computer for some hours.

@khassel
Copy link
Collaborator

khassel commented Mar 12, 2026

Thanks, that works.

Was already preparing a PR for new electron version, will add globals with that PR.

rejas pushed a commit that referenced this pull request Mar 12, 2026
- update to electron v41
- update other deps
- add missing `globals` dep, see
#4057 (comment)
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.

3 participants