fix-xml-globals
Fix XML view/fragment issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- no-globals - For ALL global variable access in XML views — sap.*, jQuery.*, AND app-namespace globals (e.g., com.example.app.utils.Handler.onPress, my.app.formatter.method)
- no-ambiguous-event-handler - For event handlers without dot prefix or local name
- no-deprecated-api - For legacy template:require syntax (space-separated)
Trigger on XML view/fragment files with errors about global variables, event handlers, formatters, type references in bindings, factory functions, or template:require.
Automatically adds core:require declarations, fixes event handler prefixes, and handles .bind($control) for functions that use 'this'.
IMPORTANT: The linter reports app-namespace globals in XML under no-globals — these MUST be fixed by this skill, NOT deferred to fix-linter-blind-spots.
For native HTML or SVG in XML views, use the fix-xml-native-html skill instead.
Pinned to revision 4e8964e24a5a, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/fix-xml-globals/SKILL.md
- skills/fix-xml-globals/LICENSE
- skills/fix-xml-globals/references/placement-and-binding.md
- skills/fix-xml-globals/scripts/README.md
- skills/fix-xml-globals/scripts/__fixtures__/nested_function_shadow.js
- skills/fix-xml-globals/scripts/__fixtures__/no_this.js
- skills/fix-xml-globals/scripts/__fixtures__/not_found.js
- skills/fix-xml-globals/scripts/__fixtures__/this_in_comment.js
- skills/fix-xml-globals/scripts/__fixtures__/this_in_string.js
- skills/fix-xml-globals/scripts/__fixtures__/uses_this_alias.js
- skills/fix-xml-globals/scripts/__fixtures__/uses_this_arrow.js
- skills/fix-xml-globals/scripts/__fixtures__/uses_this_bare.js
- skills/fix-xml-globals/scripts/__fixtures__/uses_this_member.js
- skills/fix-xml-globals/scripts/__fixtures__/uses_this_nested_in_if.js
- skills/fix-xml-globals/scripts/__fixtures__/xml/has_bind.fragment.xml
- skills/fix-xml-globals/scripts/__fixtures__/xml/multi_line.fragment.xml
- skills/fix-xml-globals/scripts/__fixtures__/xml/needs_bind.fragment.xml
- skills/fix-xml-globals/scripts/__fixtures__/xml/no_this_no_bind.fragment.xml
- skills/fix-xml-globals/scripts/verify-this-bind.js
- skills/fix-xml-globals/scripts/verify-this-bind.test.js
Every link opens the file at its source, pinned to the revision this page describes.