The noLibraryCSS flag passed to sap/ui/core/Lib.init or the deprecated sap/ui/core/Core#initLibrary tells the framework whether the library ships any theming resources. When it is not set to true, the framework requests library(-RTL).css at runtime for every registered library.
For custom libraries that never ship a library.css or library-RTL.css, this results in an unnecessary HTTP request that returns 404.
<lib namespace>/themes/<theme name>/library(-RTL).css --> 404 on themeless libs
I have seen several custom UI5 libraries where noLibraryCSS: true was simply forgotten, leading to those 404 requests.
Since the linter already inspects specific properties of the Lib.init config object (e.g. #33), the detection could be extended to also check noLibraryCSS, and warn if it is not set to true when the library doesn't provide/use theming.
Since the fix is a single property insertion into the LibraryInfo object literal, it could be also autofixed easily if applicable.
Edge case: some libraries might ship a *.less filee that is effectively empty (e.g. imports only the base theming). In my view, such libraries should count also as "theming-less".
The
noLibraryCSSflag passed tosap/ui/core/Lib.initor the deprecatedsap/ui/core/Core#initLibrarytells the framework whether the library ships any theming resources. When it is not set totrue, the framework requestslibrary(-RTL).cssat runtime for every registered library.For custom libraries that never ship a
library.cssorlibrary-RTL.css, this results in an unnecessary HTTP request that returns 404.I have seen several custom UI5 libraries where
noLibraryCSS: truewas simply forgotten, leading to those 404 requests.Since the linter already inspects specific properties of the
Lib.initconfig object (e.g. #33), the detection could be extended to also checknoLibraryCSS, and warn if it is not set totruewhen the library doesn't provide/use theming.Since the fix is a single property insertion into the LibraryInfo object literal, it could be also autofixed easily if applicable.
Edge case: some libraries might ship a
*.lessfilee that is effectively empty (e.g. imports only the base theming). In my view, such libraries should count also as "theming-less".