Repository navigation
fix(lint): recognize the Admin UI Ext global - #3686
Open
qianeric-backup wants to merge 1 commit into
Open
qianeric-backup wants to merge 1 commit into
qianeric-backup wants to merge 1 commit into
Conversation
The Admin UI JavaScript is written against ExtJS, which the admin UI pages load via ext-base.js / ext-all.js before any of the application scripts run. The ESLint configuration for `**/*.js` never declared `Ext`, so every such reference was reported as `no-undef` and eslint could not be run cleanly on the admin UI sources. Declaring `Ext` as a read-only global alongside the other bundled libraries removes that noise. Repository-wide `eslint .` drops from 5653 errors to 1360; the remaining findings are unrelated (beefrtcs, $jEncoder, globalrtc, no-unused-vars, and so on). Refs beefproject#3666
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category
Bug (lint configuration)
Feature/Issue Description
Q: Please give a brief summary of your feature/fix
A:
The Admin UI JavaScript is written against ExtJS, which the admin UI pages load through
ext-base.jsandext-all.jsbefore any application script runs. The ESLint configuration for**/*.jsnever declaredExt, so every reference was reported asno-undef.A one-line input containing only
Ext.onReady(function () {});fails under the current configuration, which means ESLint cannot be run meaningfully against the admin UI sources at all.Q: Give a technical rundown of what you have changed (if applicable)
A:
Declared
Extas a read-only global ineslint.config.js, next to the other bundled libraries (MobileEsp,evercookie,swfobject):// Libraries + Ext: "readonly", MobileEsp: "readonly",No source files change.
Extis a genuine read-only global here: the library is loaded by the page, not assigned by the application code.Test Cases
Q: Describe your test cases, what you have covered and if there are any use cases that still need addressing.
A:
Node 22.23.2, ESLint 10.13.0, after
npm ci --ignore-scripts.Before the change, the minimal repro reproduces the reported failure:
After the change the same file exits 0.
Repository-wide
npx eslint .:'Ext' is not defined)The
Extfindings drop to zero. The remaining 1360 errors are unrelated to ExtJS and untouched by this change, soeslint .is still red; examples arebeefrtcs,$jEncoder,globalrtcandrtcstealthbeing undeclared, plusno-unused-varson WebSocket event handlers. Those look like separate issues, and I did not want to widen this change into a lint cleanup. Happy to follow up on them in another PR if that is useful.No runtime behaviour is affected, since only the lint configuration changes.
Fixes #3666
Wiki Page
Not applicable; this is a build tooling correction with no user-facing behaviour.