Skip to content

fix(lint): recognize the Admin UI Ext global - #3686

Open
qianeric-backup wants to merge 1 commit into
beefproject:masterfrom
qianeric-backup:fix/eslint-ext-global
Open

qianeric-backup wants to merge 1 commit into
beefproject:masterfrom
qianeric-backup:fix/eslint-ext-global

Conversation

@qianeric-backup

Copy link
Copy Markdown

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.js and ext-all.js before any application script runs. The ESLint configuration for **/*.js never declared Ext, so every reference was reported as no-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 Ext as a read-only global in eslint.config.js, next to the other bundled libraries (MobileEsp, evercookie, swfobject):

         // Libraries
+        Ext: "readonly",
         MobileEsp: "readonly",

No source files change. Ext is 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:

$ npx eslint ext-test.js
  1:1  error  'Ext' is not defined  no-undef

After the change the same file exits 0.

Repository-wide npx eslint .:

errors
before 5653 (4294 of them 'Ext' is not defined)
after 1360

The Ext findings drop to zero. The remaining 1360 errors are unrelated to ExtJS and untouched by this change, so eslint . is still red; examples are beefrtcs, $jEncoder, globalrtc and rtcstealth being undeclared, plus no-unused-vars on 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.

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

No deployments
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.

fix(lint): recognize the Admin UI Ext global

1 participant