Issue Task New

#111543Resolve further strictNullChecks errors in the backend

Benjamin Kott 11/23/26, 20:02 updated 11/23/26, 20:02

Description

After the previous steps, the backend JavaScript still reports a number of strictNullChecks errors that fall into small groups.

Several declarations are untrue. The code completion parser and its extension tree walker return null from methods whose return type does not admit it. The promise of an event consumer, the ready promise of the form engine, the token type of the TypoScript language mode and the body of a template modal can be null as well. AjaxDispatcher::getContext() returns undefined when no context is configured. The localization wizard types its task arguments as null although the store declares undefined. The global TYPO3.Severity is declared as an instance although it holds the class.

Some locals are read where TypeScript cannot see an assignment: the promise controls of FormEngine.consume() and the field found by SlugElement, both assigned inside a callback. A few data attributes, a Sortable group and the localize list of an inline response are used without a fallback, and the preview elements of the image manipulation are used without a check.

These places should get a correct declaration where it was wrong, and a guard or a fallback where the value can really be missing, without adding non-null assertions.

Reviews 1