├── .gitattributes ├── .husky ├── pre-push └── skip.js ├── .github ├── CODEOWNERS ├── in-solidarity.yml ├── ISSUE_TEMPLATE │ └── config.yml ├── workflows │ ├── commitlint.yml │ ├── reuse-compliance.yml │ ├── e2e.yml │ └── issues.yml └── PULL_REQUEST_TEMPLATE.md ├── test ├── fixtures │ ├── transpiler │ │ ├── xml │ │ │ ├── error_UnknownDocumentKind.xml │ │ │ ├── error_UnknownNamespaceTag.view.xml │ │ │ ├── error_TopLevelAggregation.view.xml │ │ │ ├── error_ XMLComposite.control.xml │ │ │ ├── error_UnknownNamespaceAttribute.view.xml │ │ │ ├── error_NestedFragmentDefinition.fragment.xml │ │ │ ├── error_RequireAttributeParsing.view.xml │ │ │ ├── CustomControl.view.xml │ │ │ ├── error_AggregationNesting.view.xml │ │ │ ├── UnknownAttrNamespace.fragment.xml │ │ │ ├── MultipleXmlns.fragment.xml │ │ │ ├── XMLFragmentEmbedded.fragment.xml │ │ │ ├── XMLViewWithLowerCaseControl.view.xml │ │ │ ├── IgnoredNamespaces.fragment.xml │ │ │ ├── _XMLFragmentEmbeddedNoNamespace.fragment.xml │ │ │ ├── XMLFragmentWithLowerCaseControl.fragment.xml │ │ │ ├── XMLViewNamespacePrefix.view.xml │ │ │ ├── XMLFragmentEmbeddedFragDef.fragment.xml │ │ │ ├── ComplexAttributeValues.view.xml │ │ │ ├── XMLHtmlSvg.view.xml │ │ │ ├── CustomData.view.xml │ │ │ ├── XMLFragment.fragment.xml │ │ │ └── XMLRequire.view.xml │ │ └── amd │ │ │ ├── Factory_Empty.js │ │ │ ├── Factory_NotProvided_A.js │ │ │ ├── Factory_NotProvided_B.js │ │ │ ├── Require_Import.js │ │ │ ├── Factory_Empty_2.js │ │ │ ├── Noop_NoDefine.js │ │ │ ├── Noop_EmptyDefine.js │ │ │ ├── Dependencies_NotProvided_Export_Object.js │ │ │ ├── Factory_ReturnCallExp.js │ │ │ ├── ModuleName.js │ │ │ ├── NoUi5ExtendCall.js │ │ │ ├── Factory_ArrowFunctionExpr.js │ │ │ ├── Factory_ReturnNewPromise.js │ │ │ ├── Require_Errback.js │ │ │ ├── ModuleName_FactoryArrowFunction.js │ │ │ ├── Factory_ClassWithoutClassInfo.js │ │ │ ├── Factory_jQueryExtend.js │ │ │ ├── _Dependencies_NotProvided.js │ │ │ ├── Factory_ClassWithoutName.js │ │ │ ├── Noop_DynamicImport.js │ │ │ ├── ExportFlag.js │ │ │ ├── Factory_GlobalVar.js │ │ │ ├── _Dependencies_AMD.js │ │ │ ├── NameConflict.js │ │ │ ├── ModuleName_Dynamic.js │ │ │ ├── Dependencies.js │ │ │ ├── Factory_MultipleReturns.js │ │ │ ├── Dependencies_LocalImport.js │ │ │ ├── Dependencies_Var.js │ │ │ ├── Factory_MultipleReturnsArrowFunction.js │ │ │ ├── Dependencies_Dynamic.js │ │ │ ├── Factory_ArrowFunction.js │ │ │ ├── Factory_hoisted_function.js │ │ │ ├── Factory_FunctionDeclaration.js │ │ │ ├── Require_Errback_2.js │ │ │ ├── Factory_iife.js │ │ │ ├── Factory_VarDeclarationFunctionExpression.js │ │ │ ├── Require_Probing.js │ │ │ ├── Factory_cond_iife.js │ │ │ ├── Factory_cond_iife_2.js │ │ │ ├── Factory_FunctionDeclarationMultipleReturns.js │ │ │ ├── Export_Object.js │ │ │ ├── Factory_VarDeclarationFunctionExpressionMultipleReturns.js │ │ │ ├── Require_Callback.js │ │ │ ├── Factory_ClassSingletonPattern.js │ │ │ ├── Require_AMD.js │ │ │ ├── Ui5ClassWithMetadata.js │ │ │ ├── Ui5Bundle.js │ │ │ └── Factory_BasicModule.js │ ├── linter │ │ ├── projects │ │ │ ├── sap.ui.core │ │ │ │ └── src │ │ │ │ │ └── sap │ │ │ │ │ └── ui │ │ │ │ │ ├── core │ │ │ │ │ ├── library.js │ │ │ │ │ ├── Core.js │ │ │ │ │ ├── Control.js │ │ │ │ │ └── Element.js │ │ │ │ │ └── base │ │ │ │ │ ├── Object.js │ │ │ │ │ ├── EventProvider.js │ │ │ │ │ ├── Metadata.js │ │ │ │ │ └── ManagedObject.js │ │ │ ├── com.ui5.troublesome.app │ │ │ │ ├── webapp │ │ │ │ │ ├── emptyFile.js │ │ │ │ │ ├── i18n │ │ │ │ │ │ ├── i18n.properties │ │ │ │ │ │ ├── i18n_de.properties │ │ │ │ │ │ └── i18n_en.properties │ │ │ │ │ ├── test │ │ │ │ │ │ ├── unit │ │ │ │ │ │ │ ├── controller │ │ │ │ │ │ │ │ ├── Empty.qunit.js │ │ │ │ │ │ │ │ ├── Foo.qunit.js │ │ │ │ │ │ │ │ └── App.qunit.js │ │ │ │ │ │ │ └── unitTests.qunit.js │ │ │ │ │ │ ├── integration │ │ │ │ │ │ │ └── opaTests.qunit.js │ │ │ │ │ │ ├── testsuite.qunit.js │ │ │ │ │ │ └── testsuite.qunit.html │ │ │ │ │ ├── model │ │ │ │ │ │ ├── formatter.js │ │ │ │ │ │ └── models.js │ │ │ │ │ ├── view │ │ │ │ │ │ ├── App.view.xml │ │ │ │ │ │ └── DesktopMain.view.xml │ │ │ │ │ ├── controller │ │ │ │ │ │ └── TemplatingMain.controller.js │ │ │ │ │ ├── helpers │ │ │ │ │ │ └── ES6Class.helper.js │ │ │ │ │ ├── thirdparty │ │ │ │ │ │ └── topLevelCode.js │ │ │ │ │ └── bundles │ │ │ │ │ │ ├── thirdparty-bundle.js │ │ │ │ │ │ ├── ui5-bundle-without-sourcemap.js │ │ │ │ │ │ ├── ui5-bundle.js.map │ │ │ │ │ │ └── thirdparty-bundle.js.map │ │ │ │ ├── ui5lint.config.matched-patterns.mjs │ │ │ │ ├── ui5lint-custom.config.cjs │ │ │ │ ├── ui5lint.config.mjs │ │ │ │ ├── ui5.yaml │ │ │ │ ├── ui5lint.config.unmatched-patterns.mjs │ │ │ │ ├── ui5lint-custom-broken.config.cjs │ │ │ │ └── configs │ │ │ │ │ └── ui5-custom.yaml │ │ │ ├── sap.ui.suite │ │ │ │ ├── src │ │ │ │ │ └── sap │ │ │ │ │ │ └── ui │ │ │ │ │ │ └── suite │ │ │ │ │ │ ├── TaskCircle.js │ │ │ │ │ │ └── library.js │ │ │ │ └── test │ │ │ │ │ └── sap │ │ │ │ │ └── ui │ │ │ │ │ └── suite │ │ │ │ │ └── qunit │ │ │ │ │ └── TaskCircle.qunit.js │ │ │ ├── library.with.custom.paths │ │ │ │ ├── package.json │ │ │ │ ├── src │ │ │ │ │ ├── main │ │ │ │ │ │ └── js │ │ │ │ │ │ │ ├── messagebundle.properties │ │ │ │ │ │ │ └── ButtonFactory.js │ │ │ │ │ └── test │ │ │ │ │ │ └── js │ │ │ │ │ │ ├── ButtonFactory.js │ │ │ │ │ │ └── Example.html │ │ │ │ └── ui5.yaml │ │ │ ├── sap.f │ │ │ │ ├── src │ │ │ │ │ └── sap │ │ │ │ │ │ └── f │ │ │ │ │ │ ├── LinterTest.js │ │ │ │ │ │ ├── .library │ │ │ │ │ │ ├── ProductSwitchRenderer.js │ │ │ │ │ │ ├── NewControl.js │ │ │ │ │ │ └── ProductSwitch.js │ │ │ │ └── test │ │ │ │ │ └── sap │ │ │ │ │ └── f │ │ │ │ │ └── testsuite.qunit.html │ │ │ ├── legacy-dirs │ │ │ │ ├── legacy.app.a │ │ │ │ │ └── WebContent │ │ │ │ │ │ └── manifest.json │ │ │ │ ├── legacy.app.b │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ └── webapp │ │ │ │ │ │ └── manifest.json │ │ │ │ ├── legacy.lib.c │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ └── js │ │ │ │ │ │ └── .library │ │ │ │ ├── legacy.lib.a │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ └── jslib │ │ │ │ │ │ └── .library │ │ │ │ └── legacy.lib.b │ │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── uilib │ │ │ │ │ └── .library │ │ │ └── sap.ui.unified │ │ │ │ └── src │ │ │ │ └── sap │ │ │ │ └── ui │ │ │ │ └── unified │ │ │ │ └── Foo.js │ │ ├── rules │ │ │ ├── NoDeprecatedApi │ │ │ │ ├── NoDeprecatedFileType.view.html │ │ │ │ ├── NoDeprecatedFileType.view.json │ │ │ │ ├── NoDeprecatedFileType.view.tmpl │ │ │ │ ├── NoDeprecatedFileType.fragment.html │ │ │ │ ├── ModuleImport.js │ │ │ │ ├── sap.ui.require-toplevel.js │ │ │ │ ├── sap.ui.jsview.js │ │ │ │ ├── CallOnReturnType.js │ │ │ │ ├── jQuery-device.js │ │ │ │ ├── MultipleXmlns.fragment.xml │ │ │ │ ├── sap.ui.require-nested.js │ │ │ │ ├── ui5.yaml │ │ │ │ ├── setTheme_Deprecations.js │ │ │ │ ├── PrototypeClass.js │ │ │ │ ├── Configuration.beforeBootstrap.qunit.js │ │ │ │ ├── setTheme_Deprecations.ts │ │ │ │ ├── BootstrapParameters_Deprecations4.html │ │ │ │ ├── BootstrapParameters_Deprecations5.html │ │ │ │ ├── XMLHtmlSvg.view.xml │ │ │ │ ├── jQuery-plugins.js │ │ │ │ ├── XMLRequire.view.xml │ │ │ │ ├── _XMLExtensionPoint.view.xml │ │ │ │ ├── BootstrapParameters_Deprecations3.html │ │ │ │ ├── XMLFragment.fragment.xml │ │ │ │ └── NoDeprecatedApi_negative.js │ │ │ ├── renderer │ │ │ │ ├── 5ControlRenderer.js │ │ │ │ ├── TSControlRenderer.ts │ │ │ │ ├── 14Control.js │ │ │ │ ├── 13Control.js │ │ │ │ ├── 2Control.js │ │ │ │ ├── 5Control.js │ │ │ │ ├── 7Control.js │ │ │ │ ├── 2ControlRenderer.js │ │ │ │ ├── 10Control.js │ │ │ │ ├── 9Control.js │ │ │ │ ├── ControlRendererDeclarationSingleControlExported.js │ │ │ │ ├── 12Control.js │ │ │ │ ├── 11Control.js │ │ │ │ ├── 7ControlRenderer.js │ │ │ │ ├── 4Control.js │ │ │ │ ├── 8Control.js │ │ │ │ ├── 6Control.js │ │ │ │ ├── 1Control.js │ │ │ │ ├── 3Control.js │ │ │ │ └── 8ControlRenderer.js │ │ │ ├── AsyncComponentFlags │ │ │ │ ├── Negative_05 │ │ │ │ │ ├── subdir │ │ │ │ │ │ └── ParentComponent.js │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_10 │ │ │ │ │ ├── subdir │ │ │ │ │ │ └── ParentComponent.ts │ │ │ │ │ └── Component.ts │ │ │ │ ├── Negative_09 │ │ │ │ │ ├── subdir │ │ │ │ │ │ └── ParentComponent.ts │ │ │ │ │ └── Component.ts │ │ │ │ ├── Positive_12 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Negative_02 │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_08 │ │ │ │ │ ├── manifest.json │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_10 │ │ │ │ │ ├── manifest.json │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_01 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_13 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Positive_14 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Positive_15 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Negative_07 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_16 │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_11 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_07 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Positive_08 │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_06 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_02 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_20 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_05 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── subdir │ │ │ │ │ │ └── ParentComponent.js │ │ │ │ ├── Negative_12 │ │ │ │ │ ├── Component.js │ │ │ │ │ └── manifest.json │ │ │ │ ├── Positive_06 │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_13 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_09 │ │ │ │ │ └── Component.js │ │ │ │ ├── Negative_14 │ │ │ │ │ └── Component.js │ │ │ │ ├── Positive_11 │ │ │ │ │ └── Component.ts │ │ │ │ └── Negative_01 │ │ │ │ │ └── Component.js │ │ │ ├── NoPseudoModules │ │ │ │ ├── NoPseudoModules_negative.js │ │ │ │ └── NoPseudoModules.js │ │ │ ├── NoGlobals │ │ │ │ ├── ModelDataTypes.view.xml │ │ │ │ ├── NoImplicitGlobalsOData.js │ │ │ │ ├── ModelDataTypes_NewVarTypeNegative.js │ │ │ │ ├── ModelDataTypes_BindPropertyVarTypeNegative.js │ │ │ │ ├── NoGlobals_Negative.js │ │ │ │ ├── NoExportedLibValues.js │ │ │ │ ├── NoImplicitGlobalsOData_Negative.js │ │ │ │ └── FormatterGlobalBindingObject.js │ │ │ └── Directives │ │ │ │ ├── ui5.yaml │ │ │ │ ├── Directives2.html │ │ │ │ ├── Directives3.html │ │ │ │ └── Directives4.html │ │ └── general │ │ │ ├── Class.js │ │ │ ├── FunctionCall.js │ │ │ ├── Undetected.js │ │ │ ├── TSLike.js │ │ │ ├── Raw.js │ │ │ └── PlainJS.js │ ├── autofix │ │ ├── GlobalsExistingDefineWithModuleName.js │ │ ├── GlobalsExistingDefineWithModuleNameAndEmptyDeps.js │ │ ├── GlobalsExistingDefineWithExistingUnusedParamsSingle.js │ │ ├── jQuerySapOutsideModule.js │ │ ├── GlobalsExistingDefineWithExistingDepsSingle.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsSingle.js │ │ ├── GlobalsExistingDefineWithExistingUnusedParamsSingleMatching.js │ │ ├── UnusedDeprecatedImport.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiLine.js │ │ ├── GlobalsExistingDefineWithExistingUnusedParamsMultiple.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiple2.js │ │ ├── GlobalsExistingDefineWithExistingDepsMultiple.js │ │ ├── GlobalsExistingDefineWithModuleName_FunctionExpression.js │ │ ├── GlobalsJQuery.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiple.js │ │ ├── GlobalsExistingDefineWithDeps_ExistingArgumentName.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiple3.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiple4.js │ │ ├── GlobalsExistingDefineWithDeps_ArrowFunction_NoBrackets.js │ │ ├── GlobalsExistingDefineWithTrailingCommas.js │ │ ├── jQuerySapRemoveModules.js │ │ ├── GlobalsProbingRequire.js │ │ ├── GlobalsExistingDefineTypeScript.ts │ │ ├── sapMApi │ │ │ ├── SapM.view.xml │ │ │ └── SapM.js │ │ ├── manifestJson │ │ │ ├── emptyResourcesJs_01 │ │ │ │ └── manifest.json │ │ │ └── emptyResourcesJs_02 │ │ │ │ └── manifest.json │ │ ├── GlobalsExistingDefineNonStringLiteralDeps.js │ │ ├── ParsingError.view.xml │ │ ├── GlobalsExistingDefineSpecialGlobalAccess.js │ │ ├── GlobalsExistingDefineWithExistingUnusedDepsMultiple5.js │ │ ├── jQuerySapDefinitions.js │ │ ├── GlobalsTypeScript.ts │ │ ├── ParsingError.js │ │ ├── GlobalsOutsideDefine.js │ │ ├── GlobalsExistingDefineWithMissingParameters.js │ │ ├── GlobalsReturnComponentClass.js │ │ ├── jQuerySapExtendNoFix.js │ │ ├── GlobalsExistingDefineWithDeps_SpecialNames.js │ │ ├── CleanupUnused.js │ │ ├── bootstrapParameters │ │ │ ├── BootstrapParameters_SpecialAttributes.html │ │ │ ├── BootstrapParameters_CompatVersion4.html │ │ │ ├── BootstrapParameters_CompatVersion5.html │ │ │ ├── BootstrapParameters_CompatVersion.html │ │ │ ├── BootstrapParameters_CompatVersion2.html │ │ │ ├── BootstrapParameters_SpacesTabsLinebreaks2.html │ │ │ ├── BootstrapParameters_Deprecations3.html │ │ │ └── BootstrapParameters_SpacesTabsLinebreaks.html │ │ ├── GlobalsExistingDefineWithDepsWithMixedQuotes.js │ │ ├── ambiguousEventHandlers │ │ │ ├── Base.controller.js │ │ │ ├── appA │ │ │ │ ├── view │ │ │ │ │ └── User.view.xml │ │ │ │ └── controller │ │ │ │ │ └── User.controller.ts │ │ │ ├── appB │ │ │ │ ├── view │ │ │ │ │ └── User.view.xml │ │ │ │ └── controller │ │ │ │ │ └── User.controller.ts │ │ │ ├── Main.controller.js │ │ │ ├── MainTs.controller.ts │ │ │ └── BaseTs.controller.ts │ │ ├── ODataModelV4.js │ │ ├── DeprecatedApi.js │ │ ├── jQuerySapWithImport.js │ │ ├── jQuerySapWithWhitespaces.js │ │ ├── Configuration.js │ │ ├── GlobalsNotFixable.js │ │ ├── GlobalsNoModules.js │ │ ├── GlobalsExistingDefineWithoutDeps_ManyGlobals.js │ │ ├── Core.js │ │ ├── GlobalsExistingDefineWithoutDeps_ArrowFunction.js │ │ ├── GlobalsExistingDefineWithoutDeps_EmptyArray.js │ │ ├── GlobalsExistingDefineTooManyArgs.js │ │ ├── GlobalsExistingDefineWithDeps_ManyGlobalsMultiLine.js │ │ ├── GlobalsExistingDefineWithoutDeps_FunctionExpression.js │ │ └── GlobalsExistingDefineWithDeps_ManyGlobalsMultiLine2.js │ └── e2e │ │ └── runtime │ │ ├── ui5.yaml │ │ ├── src │ │ ├── library.js │ │ └── .library │ │ ├── test │ │ └── qunit │ │ │ ├── testsuite.qunit.html │ │ │ ├── sap.ui.base.Object.qunit.js │ │ │ ├── jQuery.sap.resources.qunit.js │ │ │ ├── jQuery.sap.pad.qunit.js │ │ │ ├── testsuite.qunit.js │ │ │ └── jQuery.sap.charToUpperCase.qunit.js │ │ └── package.json ├── e2e │ ├── snapshots │ │ ├── runtime.ts.snap │ │ ├── compare-ui5lint-snapshots.ts.snap │ │ └── compare-ui5lint-fix-snapshots.ts.snap │ └── compare-ui5lint-snapshots.ts └── lib │ ├── formatter │ └── snapshots │ │ ├── html.ts.snap │ │ ├── text.ts.snap │ │ ├── coverage.ts.snap │ │ └── markdown.ts.snap │ ├── linter │ ├── snapshots │ │ ├── linter.ts.snap │ │ └── LinterContext.ts.snap │ ├── rules │ │ ├── snapshots │ │ │ ├── XmlInJs.ts.snap │ │ │ ├── renderer.ts.snap │ │ │ ├── Directives.ts.snap │ │ │ ├── NoGlobals.ts.snap │ │ │ ├── CSPCompliance.ts.snap │ │ │ ├── NoDeprecatedApi.ts.snap │ │ │ ├── NoPseudoModules.ts.snap │ │ │ └── AsyncComponentFlags.ts.snap │ │ ├── NoGlobals.ts │ │ ├── XmlInJs.ts │ │ ├── renderer.ts │ │ ├── CSPCompliance.ts │ │ ├── Directives.ts │ │ ├── NoPseudoModules.ts │ │ ├── NoDeprecatedApi.ts │ │ └── AsyncComponentFlags.ts │ ├── ui5Types │ │ └── snapshots │ │ │ └── directives.ts.snap │ ├── binding │ │ ├── snapshots │ │ │ └── BindingLinter.ts.snap │ │ └── lib │ │ │ └── snapshots │ │ │ └── BindingParser.ts.snap │ ├── xmlTemplate │ │ ├── snapshots │ │ │ └── transpiler.ts.snap │ │ ├── generator │ │ │ └── snapshots │ │ │ │ └── ControllerByIdDtsGenerator.ts.snap │ │ └── transpiler.ts │ ├── amdTranspiler │ │ ├── snapshots │ │ │ └── transpiler.ts.snap │ │ └── transpiler.ts │ └── messages.ts │ ├── snapshots │ └── index.integration.ts.snap │ ├── autofix │ ├── snapshots │ │ ├── autofix.fixtures.ts.snap │ │ └── autofix.projects.ts.snap │ └── autofix.fixtures.ts │ └── cli │ └── version.ts ├── .release-please-manifest.json ├── resources └── types │ ├── package.json │ ├── sapui5 │ ├── sap.apf.d.ts │ ├── sap.ndc.d.ts │ ├── sap.ovp.d.ts │ ├── sap.ui.dt.d.ts │ ├── sap.ui.fl.d.ts │ ├── sap.ui.vk.d.ts │ ├── sap.fe.base.d.ts │ ├── sap.fe.core.d.ts │ ├── sap.fe.ina.d.ts │ ├── sap.fe.test.d.ts │ ├── sap.sac.df.d.ts │ ├── sap.ui.rta.d.ts │ ├── sap.zen.dsh.d.ts │ ├── sap.fe.macros.d.ts │ ├── sap.fe.tools.d.ts │ ├── sap.insights.d.ts │ ├── sap.fe.controls.d.ts │ ├── sap.fe.templates.d.ts │ ├── sap.feedback.ui.d.ts │ ├── sap.uiext.inbox.d.ts │ ├── sap.ushell_abap.d.ts │ ├── sap.zen.commons.d.ts │ ├── sap.zen.crosstab.d.ts │ ├── sap.esh.search.ui.d.ts │ ├── sap.fe.navigation.d.ts │ ├── sap.fe.placeholder.d.ts │ ├── sap.ui.codeeditor.d.ts │ ├── sap.ui.testrecorder.d.ts │ ├── sap.ui.webc.common.d.ts │ ├── sap.ui.documentation.d.ts │ ├── sap.webanalytics.core.d.ts │ ├── sap.f.d.ts │ ├── sap.m.d.ts │ ├── sap.ui.generic.template.d.ts │ ├── sap.fe.plugins.managecache.d.ts │ ├── sap.me.d.ts │ ├── sap.tnt.d.ts │ ├── sap.uxap.d.ts │ ├── sap.viz.d.ts │ ├── sap.ca.ui.d.ts │ ├── sap.chart.d.ts │ ├── sap.gantt.d.ts │ ├── sap.makit.d.ts │ ├── sap.ui.mdc.d.ts │ ├── sap.ui.ux3.d.ts │ ├── sap.ui.vbm.d.ts │ ├── sap.ui.vtm.d.ts │ ├── sap.ushell.d.ts │ ├── sap.ui.comp.d.ts │ ├── sap.ui.core.d.ts │ ├── sap.rules.ui.d.ts │ ├── sap.ui.export.d.ts │ ├── sap.ui.layout.d.ts │ ├── sap.ui.suite.d.ts │ ├── sap.ui.table.d.ts │ ├── sap.ui.commons.d.ts │ ├── sap.ui.support.d.ts │ ├── sap.ui.unified.d.ts │ ├── sap.ui.webc.main.d.ts │ ├── sap.collaboration.d.ts │ ├── sap.ui.generic.app.d.ts │ ├── sap.ui.integration.d.ts │ ├── sap.ui.webc.fiori.d.ts │ ├── sap.suite.ui.commons.d.ts │ ├── sap.ui.richtexteditor.d.ts │ ├── sap.suite.ui.microchart.d.ts │ └── sap.suite.ui.generic.template.d.ts │ ├── index.d.ts │ ├── jquery.sap.mobile.d.ts │ └── pseudo-modules │ ├── sap.ui.suite.d.ts │ ├── sap.ui.richtexteditor.d.ts │ ├── sap.suite.ui.generic.template.d.ts │ └── sap.ui.vtm.d.ts ├── bin └── ui5lint.js ├── docs └── images │ └── UI5_logo_wide.png ├── .npmrc ├── src ├── linter │ ├── xmlTemplate │ │ ├── lib │ │ │ ├── EventHandlerResolver.d.ts │ │ │ └── JSTokenizer.d.ts │ │ └── generator │ │ │ └── ViewGenerator.ts │ ├── ui5Types │ │ ├── fix │ │ │ ├── XmlEnabledFix.ts │ │ │ └── collections │ │ │ │ ├── globalFixes.ts │ │ │ │ └── sapUiCompFixes.ts │ │ └── amdTranspiler │ │ │ └── util.ts │ ├── MessageArgs.ts │ ├── html │ │ └── linter.ts │ ├── dotLibrary │ │ └── linter.ts │ ├── yaml │ │ └── linter.ts │ └── manifestJson │ │ └── linter.ts ├── cli │ ├── LinterArgs.ts │ ├── version.ts │ └── middlewares │ │ └── base.ts └── autofix │ └── generateChangesJson.ts ├── tsconfig.build.json ├── ava-e2e.config.js ├── .licensee.json ├── ava.config.js ├── .editorconfig ├── SUPPORT.md ├── .nycrc └── commitlint.config.mjs /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | npm run hooks:pre-push 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | @UI5/ui5-team-cor-fnd 2 | -------------------------------------------------------------------------------- /.github/in-solidarity.yml: -------------------------------------------------------------------------------- 1 | _extends: ietf/terminology 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_UnknownDocumentKind.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.release-please-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "1.20.6" 3 | } 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | -------------------------------------------------------------------------------- /resources/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "types": "index.d.ts" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.core/src/sap/ui/core/library.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/emptyFile.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.suite/src/sap/ui/suite/TaskCircle.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.suite/src/sap/ui/suite/library.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/NoDeprecatedFileType.view.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/NoDeprecatedFileType.view.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/NoDeprecatedFileType.view.tmpl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/NoDeprecatedFileType.fragment.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_UnknownNamespaceTag.view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.husky/skip.js: -------------------------------------------------------------------------------- 1 | if (process.env.CI) { 2 | process.exit(0); 3 | } else { 4 | process.exit(1); 5 | } 6 | -------------------------------------------------------------------------------- /bin/ui5lint.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import initCli from "../lib/cli.js"; 3 | 4 | initCli(); 5 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_Empty.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function () { 2 | "use strict" 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_NotProvided_A.js: -------------------------------------------------------------------------------- 1 | sap.ui.define("sap/ui/core/UIComponent"); 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_NotProvided_B.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/UIComponent"]); 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Require_Import.js: -------------------------------------------------------------------------------- 1 | sap.ui.require(["my/module", `my/other/module`]); 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_TopLevelAggregation.view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/images/UI5_logo_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/docs/images/UI5_logo_wide.png -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/ModuleImport.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/model/odata/ODataModel"]); 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_Empty_2.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | "use strict"; 3 | }); 4 | -------------------------------------------------------------------------------- /test/e2e/snapshots/runtime.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/e2e/snapshots/runtime.ts.snap -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Enforce public npm registry 2 | registry=https://registry.npmjs.org/ 3 | lockfile-version=3 4 | ignore-scripts=true 5 | -------------------------------------------------------------------------------- /test/lib/formatter/snapshots/html.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/formatter/snapshots/html.ts.snap -------------------------------------------------------------------------------- /test/lib/formatter/snapshots/text.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/formatter/snapshots/text.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/snapshots/linter.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/snapshots/linter.ts.snap -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Noop_NoDefine.js: -------------------------------------------------------------------------------- 1 | // This file contains "sap.ui.define", but no real sap.ui.define call 2 | sap.ui.define; 3 | -------------------------------------------------------------------------------- /test/lib/formatter/snapshots/coverage.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/formatter/snapshots/coverage.ts.snap -------------------------------------------------------------------------------- /test/lib/formatter/snapshots/markdown.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/formatter/snapshots/markdown.ts.snap -------------------------------------------------------------------------------- /test/lib/snapshots/index.integration.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/snapshots/index.integration.ts.snap -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Noop_EmptyDefine.js: -------------------------------------------------------------------------------- 1 | // This file contains "sap.ui.define", but no real sap.ui.define call 2 | sap.ui.define(); 3 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_ XMLComposite.control.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/XmlInJs.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/XmlInJs.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/renderer.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/renderer.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/snapshots/LinterContext.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/snapshots/LinterContext.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.apf.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.apf.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ndc.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ndc.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ovp.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ovp.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.dt.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.dt.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.fl.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.fl.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.vk.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.vk.d.ts"; 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/library.with.custom.paths/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "library.with.custom.paths", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.f/src/sap/f/LinterTest.js: -------------------------------------------------------------------------------- 1 | // This project is used to test the linter with the namespace of an OpenUI5 project. 2 | -------------------------------------------------------------------------------- /test/lib/autofix/snapshots/autofix.fixtures.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/autofix/snapshots/autofix.fixtures.ts.snap -------------------------------------------------------------------------------- /test/lib/autofix/snapshots/autofix.projects.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/autofix/snapshots/autofix.projects.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/Directives.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/Directives.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/NoGlobals.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/NoGlobals.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.base.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.base.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.core.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.core.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.ina.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.ina.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.test.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.test.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.sac.df.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.sac.df.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.rta.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.rta.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.zen.dsh.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.zen.dsh.d.ts"; 4 | -------------------------------------------------------------------------------- /test/e2e/snapshots/compare-ui5lint-snapshots.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/e2e/snapshots/compare-ui5lint-snapshots.ts.snap -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithModuleName.js: -------------------------------------------------------------------------------- 1 | sap.ui.define("my/module", function() { 2 | const input = new sap.m.Input(); 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Dependencies_NotProvided_Export_Object.js: -------------------------------------------------------------------------------- 1 | sap.ui.define({ 2 | add: function (x, y) { 3 | return x + y; 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_ReturnCallExp.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/base/util/merge"], function (merge) { 2 | return merge({}, {}); 3 | }); 4 | -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/CSPCompliance.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/CSPCompliance.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/ui5Types/snapshots/directives.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/ui5Types/snapshots/directives.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.macros.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.macros.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.tools.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.tools.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.insights.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.insights.d.ts"; 4 | -------------------------------------------------------------------------------- /test/e2e/snapshots/compare-ui5lint-fix-snapshots.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/e2e/snapshots/compare-ui5lint-fix-snapshots.ts.snap -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_UnknownNamespaceAttribute.view.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /test/lib/linter/binding/snapshots/BindingLinter.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/binding/snapshots/BindingLinter.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/NoPseudoModules.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/NoPseudoModules.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/xmlTemplate/snapshots/transpiler.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/xmlTemplate/snapshots/transpiler.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.controls.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.controls.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.templates.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.templates.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.feedback.ui.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.feedback.ui.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.uiext.inbox.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.uiext.inbox.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ushell_abap.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ushell_abap.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.zen.commons.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.zen.commons.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.zen.crosstab.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.zen.crosstab.d.ts"; 4 | -------------------------------------------------------------------------------- /src/linter/xmlTemplate/lib/EventHandlerResolver.d.ts: -------------------------------------------------------------------------------- 1 | export default abstract class EventHandlerResolver { 2 | static parse(sValue: string): string[]; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/ModuleName.js: -------------------------------------------------------------------------------- 1 | sap.ui.define("MyModule", function () { 2 | return function () { 3 | return "MyModuleContent"; 4 | }; 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/NoUi5ExtendCall.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function() { 2 | var foo = Data.extend(); 3 | Data.extend(); 4 | return Data.extend(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/lib/linter/amdTranspiler/snapshots/transpiler.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/amdTranspiler/snapshots/transpiler.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.esh.search.ui.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.esh.search.ui.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.navigation.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.navigation.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.placeholder.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.placeholder.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.codeeditor.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.codeeditor.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.testrecorder.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.testrecorder.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.webc.common.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.webc.common.d.ts"; 4 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithModuleNameAndEmptyDeps.js: -------------------------------------------------------------------------------- 1 | sap.ui.define("my/module", [], function() { 2 | const input = new sap.m.Input(); 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_ArrowFunctionExpr.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/mvc/Controller"], (Controller) => Controller.extend("MyController", {})); 2 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_ReturnNewPromise.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function() { 2 | return new Promise(function(resolve) { 3 | resolve(); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /test/lib/linter/binding/lib/snapshots/BindingParser.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/binding/lib/snapshots/BindingParser.ts.snap -------------------------------------------------------------------------------- /test/lib/linter/rules/snapshots/AsyncComponentFlags.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/rules/snapshots/AsyncComponentFlags.ts.snap -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | // For creating a release build, only compile the src dir 3 | "extends": "./tsconfig.base.json", 4 | "include": ["src/**/*"], 5 | } 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.documentation.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.documentation.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.webanalytics.core.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.webanalytics.core.d.ts"; 4 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedParamsSingle.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function(Input) { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/jQuerySapOutsideModule.js: -------------------------------------------------------------------------------- 1 | jQuery.sap.assert(false, "Error message"); 2 | jQuery.sap.getResourcePath(''); 3 | 4 | sap.ui.define([], function() {}); 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.f.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.f.d.ts"; 4 | import "../pseudo-modules/sap.f"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.m.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.m.d.ts"; 4 | import "../pseudo-modules/sap.m"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.generic.template.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.generic.template.d.ts"; 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/general/Class.js: -------------------------------------------------------------------------------- 1 | import BaseObject from "sap/ui/base/Object"; 2 | 3 | class Foo extends BaseObject { 4 | constructor() { 5 | super(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/library.with.custom.paths/src/main/js/messagebundle.properties: -------------------------------------------------------------------------------- 1 | # Translation file of library library.with.custom.paths. 2 | ANY_TEXT=AnyText 3 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Require_Errback.js: -------------------------------------------------------------------------------- 1 | sap.ui.require(["some/module"], (module) => { 2 | module.renderButton(); 3 | }, (err) => { 4 | console.log(err); 5 | }); 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.fe.plugins.managecache.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.fe.plugins.managecache.d.ts"; 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.me.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.me.d.ts"; 4 | import "../pseudo-modules/sap.me"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingDepsSingle.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button"], function(Button) { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsSingle.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button"], function() { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedParamsSingleMatching.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function(Button) { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/UnusedDeprecatedImport.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/Configuration", "sap/m/Button"], function(Configuration, Button) { 2 | const button = new Button(); 3 | }); -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/ModuleName_FactoryArrowFunction.js: -------------------------------------------------------------------------------- 1 | sap.ui.define("MyModule", () => { 2 | return function () { 3 | return "MyModuleContent"; 4 | }; 5 | }); 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.tnt.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.tnt.d.ts"; 4 | import "../pseudo-modules/sap.tnt"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.uxap.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.uxap.d.ts"; 4 | import "../pseudo-modules/sap.uxap"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.viz.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.viz.d.ts"; 4 | import "../pseudo-modules/sap.viz"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsMultiLine.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/m/Input" 3 | ], function() { 4 | const button = new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/ui5lint.config.matched-patterns.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | files: [ 3 | "webapp/controller/*", 4 | "ui5.yaml", 5 | ], 6 | }; 7 | -------------------------------------------------------------------------------- /resources/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import "./jquery.sap.mobile"; 2 | import "./jquery.sap"; 3 | 4 | // Note: pseudo-modules are imported individually per library via compilerOptions paths mappings 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ca.ui.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ca.ui.d.ts"; 4 | import "../pseudo-modules/sap.ca.ui"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.chart.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.chart.d.ts"; 4 | import "../pseudo-modules/sap.chart"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.gantt.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.gantt.d.ts"; 4 | import "../pseudo-modules/sap.gantt"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.makit.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.makit.d.ts"; 4 | import "../pseudo-modules/sap.makit"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.mdc.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.mdc.d.ts"; 4 | import "../pseudo-modules/sap.ui.mdc"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.ux3.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.ux3.d.ts"; 4 | import "../pseudo-modules/sap.ui.ux3"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.vbm.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.vbm.d.ts"; 4 | import "../pseudo-modules/sap.ui.vbm"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.vtm.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.vtm.d.ts"; 4 | import "../pseudo-modules/sap.ui.vtm"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ushell.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ushell.d.ts"; 4 | import "../pseudo-modules/sap.ushell"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedParamsMultiple.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function(Input, Button, ComboBox) { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_ClassWithoutClassInfo.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 2 | return UIComponent.extend("mycomp.Component"); 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_jQueryExtend.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/thirdparty/jquery", "./base"], function (jQuery, base) { 2 | return jQuery.extend(base, { foo: "bar" }); 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_NestedFragmentDefinition.fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.comp.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.comp.d.ts"; 4 | import "../pseudo-modules/sap.ui.comp"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.core.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.core.d.ts"; 4 | import "../pseudo-modules/sap.ui.core"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsMultiple2.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Input", "sap/m/Button"], function() { 2 | "use strict"; 3 | 4 | new sap.m.Input(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/legacy-dirs/legacy.app.a/WebContent/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "com.app", 5 | "type": "application" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/_Dependencies_NotProvided.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function (require, exports, modules) { 2 | require(["sap/ui/core/UIComponent"]); 3 | exports("Hello World"); 4 | }); 5 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_RequireAttributeParsing.view.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.rules.ui.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.rules.ui.d.ts"; 4 | import "../pseudo-modules/sap.rules.ui"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.export.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.export.d.ts"; 4 | import "../pseudo-modules/sap.ui.export"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.layout.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.layout.d.ts"; 4 | import "../pseudo-modules/sap.ui.layout"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.suite.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.suite.d.ts"; 4 | import "../pseudo-modules/sap.ui.suite"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.table.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.table.d.ts"; 4 | import "../pseudo-modules/sap.ui.table"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingDepsMultiple.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button", "sap/m/Input"], function(Button, Input) { 2 | "use strict"; 3 | 4 | new sap.m.Input(); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithModuleName_FunctionExpression.js: -------------------------------------------------------------------------------- 1 | const factoryFn = function() { 2 | const input = sap.m.Input(); 3 | }; 4 | 5 | sap.ui.define("my/module", factoryFn); 6 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | appTitle=com.ui5.troublesome.app 2 | appDescription=UI5 Application com.ui5.troublesome.app 3 | btnText=Say Hello 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/i18n/i18n_de.properties: -------------------------------------------------------------------------------- 1 | appTitle=com.ui5.troublesome.app 2 | appDescription=UI5 Application com.ui5.troublesome.app 3 | btnText=Sag Hallo 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/i18n/i18n_en.properties: -------------------------------------------------------------------------------- 1 | appTitle=com.ui5.troublesome.app 2 | appDescription=UI5 Application com.ui5.troublesome.app 3 | btnText=Say Hello 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/legacy-dirs/legacy.app.b/src/main/webapp/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "com.app", 5 | "type": "application" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_ClassWithoutName.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/mvc/ControllerExtension"], function(ControllerExtension) { 2 | return ControllerExtension.extend({}); 3 | }); 4 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Noop_DynamicImport.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | import('./foo') 3 | .then(() => { console.log('success') }) 4 | .catch(() => { console.log('error') }) 5 | } 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.commons.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.commons.d.ts"; 4 | import "../pseudo-modules/sap.ui.commons"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.support.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.support.d.ts"; 4 | import "../pseudo-modules/sap.ui.support"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.unified.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.unified.d.ts"; 4 | import "../pseudo-modules/sap.ui.unified"; 5 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/renderer/5ControlRenderer.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function () { 2 | // Deprecated declaration. {apiVersion: 2} must be provided. 3 | return function (oRm, oMyControl) {}; 4 | }); 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.webc.main.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.webc.main.d.ts"; 4 | import "../pseudo-modules/sap.ui.webc.main"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsJQuery.js: -------------------------------------------------------------------------------- 1 | /* global jQuery, $ */ 2 | // Usage of global jQuery / $ should **for now** not be fixed 3 | sap.ui.define(function() { 4 | jQuery("#container"); 5 | $.noop(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/general/FunctionCall.js: -------------------------------------------------------------------------------- 1 | import values from "sap/base/util/values"; 2 | const getValues = () => values; 3 | getValues()({foo: "bar"}); // Special case: CallExpression on a CallExpression 4 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.core/src/sap/ui/core/Core.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | "use strict"; 3 | if (sap.ui.getCore && sap.ui.getCore()) { 4 | return sap.ui.getCore(); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/ExportFlag.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/mvc/ControllerExtension"], function(ControllerExtension) { 2 | return ControllerExtension.extend("my.ReuseExtension", {}); 3 | }, true); 4 | -------------------------------------------------------------------------------- /test/lib/linter/xmlTemplate/generator/snapshots/ControllerByIdDtsGenerator.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UI5/linter/HEAD/test/lib/linter/xmlTemplate/generator/snapshots/ControllerByIdDtsGenerator.ts.snap -------------------------------------------------------------------------------- /resources/types/sapui5/sap.collaboration.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.collaboration.d.ts"; 4 | import "../pseudo-modules/sap.collaboration"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.generic.app.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.generic.app.d.ts"; 4 | import "../pseudo-modules/sap.ui.generic.app"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.integration.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.integration.d.ts"; 4 | import "../pseudo-modules/sap.ui.integration"; 5 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.webc.fiori.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.webc.fiori.d.ts"; 4 | import "../pseudo-modules/sap.ui.webc.fiori"; 5 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_GlobalVar.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | [ 3 | "sap/ui/core/mvc/Controller", 4 | "sap/ui/core/UIComponent", 5 | "sap/ui/core/routing/History", 6 | ], 7 | window.MyFactory 8 | ); 9 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.suite.ui.commons.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.suite.ui.commons.d.ts"; 4 | import "../pseudo-modules/sap.suite.ui.commons"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsMultiple.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button", "sap/m/Input"], function() { 2 | "use strict"; 3 | 4 | new sap.m.Input(); 5 | new sap.m.Input(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/renderer/TSControlRenderer.ts: -------------------------------------------------------------------------------- 1 | var myControlRenderer = {}; 2 | myControlRenderer.apiVersion = 1; 3 | myControlRenderer.render = (oRm, oMyControl) => { }; 4 | export default myControlRenderer; 5 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/_Dependencies_AMD.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["require", "exports", "modules"], function (require, exports, modules) { 2 | require(["sap/ui/core/UIComponent"]); 3 | exports("Hello World"); 4 | }); 5 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/CustomControl.view.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.ui.richtexteditor.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.ui.richtexteditor.d.ts"; 4 | import "../pseudo-modules/sap.ui.richtexteditor"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithDeps_ExistingArgumentName.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/f/Avatar" 3 | ], function(Avatar) { 4 | const fAvatar = new Avatar(); 5 | const mAvatar = new sap.m.Avatar(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/ui5lint-custom.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignores: [ 3 | "webapp/test/**/*", 4 | "!webapp/test/integration/opaTests.qunit.js", 5 | "ui5.yaml" 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /test/lib/linter/rules/NoGlobals.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /test/lib/linter/rules/XmlInJs.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /test/lib/linter/rules/renderer.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.suite.ui.microchart.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.suite.ui.microchart.d.ts"; 4 | import "../pseudo-modules/sap.suite.ui.microchart"; 5 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/library.with.custom.paths/src/main/js/ButtonFactory.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button"], function (Button) { 2 | "use strict"; 3 | 4 | return { 5 | createButton: () => new Button() 6 | }; 7 | }); 8 | -------------------------------------------------------------------------------- /test/lib/linter/rules/CSPCompliance.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /test/lib/linter/rules/Directives.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /test/lib/linter/rules/NoPseudoModules.ts: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from "node:url"; 2 | import {runLintRulesTests} from "../_linterHelper.js"; 3 | 4 | const filePath = fileURLToPath(import.meta.url); 5 | runLintRulesTests(filePath); 6 | -------------------------------------------------------------------------------- /src/linter/xmlTemplate/lib/JSTokenizer.d.ts: -------------------------------------------------------------------------------- 1 | type RequireMap = Record; 2 | export function parseJS(sSource: string): RequireMap; 3 | export default class JSTokenizer { 4 | static parseJS(sSource: string): RequireMap; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsMultiple3.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/ComboBox", "sap/m/Input", "sap/m/Button"], function() { 2 | "use strict"; 3 | 4 | new sap.m.Button(); 5 | new sap.m.Input(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithExistingUnusedDepsMultiple4.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/ComboBox", "sap/m/Input", "sap/m/Button"], function() { 2 | "use strict"; 3 | 4 | new sap.m.Input(); 5 | new sap.m.Button(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/ui5lint.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | files: [ 3 | "webapp/**/*" 4 | ], 5 | ignores: [ 6 | "test/**/*", 7 | "!test/sap/m/visual/Wizard.spec.js", 8 | ], 9 | }; 10 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/unit/controller/Empty.qunit.js: -------------------------------------------------------------------------------- 1 | // This file ensures that the linter does not crash (Failed to map back to source) when it encounters a QUnit test module with just a comment 2 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.core/src/sap/ui/base/Object.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["./Metadata"], function(Metadata) { 2 | "use strict"; 3 | var BaseObject = Metadata.createClass("sap.ui.base.Object", {}); 4 | return BaseObject; 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/sap.ui.require-toplevel.js: -------------------------------------------------------------------------------- 1 | sap.ui.require(["sap/m/Button"], (Button) => { 2 | new Button({ 3 | tap: () => console.log("Tapped") // Event "tap" is deprecated 4 | }).placeAt("button"); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/NameConflict.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/UIComponent", `sap/ui/Device`], function (UIComponent) { 2 | "use strict"; 3 | 4 | return UIComponent.extend("com.ui5.troublesome.app.UIComponent", {}); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/e2e/runtime/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "4.0" 2 | metadata: 3 | name: ui5linter.test.e2e.runtime 4 | type: library 5 | framework: 6 | name: OpenUI5 7 | version: "1.120.30" 8 | libraries: 9 | - name: sap.ui.core 10 | -------------------------------------------------------------------------------- /ava-e2e.config.js: -------------------------------------------------------------------------------- 1 | import defaultAvaConfig from "./ava.config.js"; 2 | 3 | defaultAvaConfig.files = ["test/e2e/**/*.ts"]; 4 | defaultAvaConfig.timeout = "60s"; // Increased timeout for slower CI environments 5 | 6 | export default defaultAvaConfig; 7 | -------------------------------------------------------------------------------- /resources/types/sapui5/sap.suite.ui.generic.template.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | import "@sapui5/types/types/sap.suite.ui.generic.template.d.ts"; 4 | import "../pseudo-modules/sap.suite.ui.generic.template"; 5 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithDeps_ArrowFunction_NoBrackets.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button"], Button => { 2 | const button = new Button({ 3 | text: "Hello" 4 | }); 5 | var model = new sap.ui.model.json.JSONModel(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithTrailingCommas.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button",], function(Button,) { 2 | const button = new sap.m.Button({ 3 | text: "Hello" 4 | }); 5 | var model = new sap.ui.model.json.JSONModel(); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/sap.ui.jsview.js: -------------------------------------------------------------------------------- 1 | sap.ui.jsview("ui5lint.example.view.HelloWorld", { // sap.ui.jsview is deprecated 2 | getControllerName : function() { 3 | return "ui5lint.example.controller.HelloWorld"; 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/ModuleName_Dynamic.js: -------------------------------------------------------------------------------- 1 | const moduleName = (new Date().getTime() % 2 === 0 ? "My" : "Your") + " Module"; 2 | sap.ui.define(moduleName, function () { 3 | return function () { 4 | return "MyModuleContent"; 5 | }; 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Dependencies.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/UIComponent", `sap/ui/Device`], function (UIComponent, Device, models) { 2 | "use strict"; 3 | 4 | return UIComponent.extend("com.ui5.troublesome.app.Component", {}); 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_MultipleReturns.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["some/module"], function (merge) { 2 | const otherModule = sap.ui.require("some/other/module"); 3 | if (otherModule) { 4 | return otherModule; 5 | } 6 | return merge; 7 | }); 8 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/error_AggregationNesting.view.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/fixtures/autofix/jQuerySapRemoveModules.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/base/strings/NormalizePolyfill", "jquery.sap.unicode"], function () { 2 | // https://github.com/UI5/linter/issues/527 3 | const isNFC = jQuery.sap.isStringNFC("test NFC string"); 4 | }); 5 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.core/src/sap/ui/base/EventProvider.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["./Object"], function(BaseObject) { 2 | "use strict"; 3 | var EventProvider = BaseObject.extend("sap.ui.base.EventProvider", {}); 4 | return EventProvider; 5 | }); 6 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_05/subdir/ParentComponent.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 2 | "use strict"; 3 | 4 | return UIComponent.extend("mycomp.subdir.ParentComponent", { 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsProbingRequire.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | 3 | const Button = sap.ui.require("sap/m/Button"); 4 | if (Button) { 5 | const oButton = new Button(); 6 | } 7 | 8 | const Input = new sap.m.Input(); 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/model/formatter.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function () { 2 | "use strict"; 3 | 4 | return { 5 | formatValue: function (value) { 6 | return value && value.toUpperCase(); 7 | } 8 | }; 9 | }); 10 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/UnknownAttrNamespace.fragment.xml: -------------------------------------------------------------------------------- 1 | 4 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/controller/TemplatingMain.controller.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["./BaseController"], function (BaseController) { 2 | "use strict"; 3 | 4 | const TemplatingMainController = BaseController.extend("com.ui5.troublesome.app.controller.TemplatingMain", { 5 | }); 6 | return TemplatingMainController; 7 | }); 8 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/sap.ui.require-nested.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | return { 3 | renderButton() { 4 | sap.ui.require(["sap/m/Button"], (Button) => { 5 | new Button({ 6 | tap: () => console.log("Tapped") // Event "tap" is deprecated 7 | }).placeAt("button"); 8 | }); 9 | } 10 | }; 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/IgnoredNamespaces.fragment.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | // https://api.qunitjs.com/config/autostart/ 2 | QUnit.config.autostart = false; 3 | 4 | sap.ui.getCore().attachInit(function () { 5 | "use strict"; 6 | 7 | sap.ui.require(["integration/HelloJourney"], function () { 8 | QUnit.start(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/autofix/CleanupUnused.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/Core", "sap/ui/core/Configuration"], function(Core, Configuration) { 2 | Core.getConfiguration().setRTL(false); // Requires two iterations 3 | 4 | Configuration.setRTL(false); 5 | Configuration.getLocale(); 6 | // After migration, dependencies "Core" and "Configuration" have become obsolete 7 | }); -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_09/subdir/ParentComponent.ts: -------------------------------------------------------------------------------- 1 | import UIComponent from "sap/ui/core/UIComponent"; 2 | import { IAsyncContentCreation } from "sap/ui/core/library"; 3 | 4 | export default class Component extends UIComponent implements IAsyncContentCreation { 5 | __implements__sap_ui_core_IAsyncContentCreation: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_12/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Async flag (rootView only, no routing) in manifest.json 3 | // No manifest: "json" configuration in metadata 4 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 5 | "use strict"; 6 | 7 | return UIComponent.extend("mycomp.Component"); 8 | }); 9 | -------------------------------------------------------------------------------- /test/fixtures/autofix/bootstrapParameters/BootstrapParameters_SpecialAttributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Special attributes (one character long, w/ or w/o values) 4 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/helpers/ES6Class.helper.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ${copyright} 3 | */ 4 | 5 | sap.ui.define([], function () { 6 | "use strict"; 7 | 8 | class ES6Class { 9 | toString() { 10 | return this.#join("", ""); 11 | } 12 | #join() { 13 | // A private method 14 | } 15 | } 16 | 17 | return ES6Class; 18 | }); 19 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_02/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Async flags are maintained in manifest.json 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_08/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | 4 | "sap.app": { 5 | "id": "mycomp", 6 | "type": "application", 7 | "i18n": "i18n/i18n.properties", 8 | "title": "{{appTitle}}", 9 | "description": "{{appDescription}}", 10 | "applicationVersion": { 11 | "version": "1.0.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_10/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | 4 | "sap.app": { 5 | "id": "mycomp", 6 | "type": "application", 7 | "i18n": "i18n/i18n.properties", 8 | "title": "{{appTitle}}", 9 | "description": "{{appDescription}}", 10 | "applicationVersion": { 11 | "version": "1.0.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithDepsWithMixedQuotes.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | 'sap/m/Button', 3 | "sap/m/Avatar", 4 | 'sap/m/ComboBox', 5 | `sap/m/Menu` 6 | ], function( 7 | ButtonRenamed, 8 | Avatar 9 | ) { 10 | const button = new sap.m.Button({ 11 | text: "Hello" 12 | }); 13 | const avatar = new sap.m.Avatar(); 14 | new sap.m.Input(); 15 | }); 16 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Require_Probing.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | return { 3 | maybeTable() { 4 | var Table = sap.ui.require("sap/m/Table"); // Convert to import for Table 5 | if (Table) { 6 | var JSONModel = sap.ui.require("sap/ui/model/json/JSONModel"); 7 | return new Table().setModel(new JSONModel()); 8 | } 9 | } 10 | }; 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/_XMLFragmentEmbeddedNoNamespace.fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/lib/linter/xmlTemplate/transpiler.ts: -------------------------------------------------------------------------------- 1 | import path from "node:path"; 2 | import {fileURLToPath} from "node:url"; 3 | import {createTestsForFixtures} from "./_helper.js"; 4 | 5 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 6 | const fixtures = path.join(__dirname, "..", "..", "..", "fixtures", "transpiler", "xml"); 7 | 8 | createTestsForFixtures(fixtures); 9 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/unit/unitTests.qunit.js: -------------------------------------------------------------------------------- 1 | /* global QUnit */ 2 | 3 | // https://api.qunitjs.com/config/autostart/ 4 | QUnit.config.autostart = false; 5 | 6 | sap.ui.getCore().attachInit(function () { 7 | "use strict"; 8 | 9 | sap.ui.require(["unit/controller/App.qunit"], function () { 10 | QUnit.start(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_08/Component.js: -------------------------------------------------------------------------------- 1 | // No rootView or router config and no IAsyncContentCreation interface implemented 2 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 3 | "use strict"; 4 | 5 | return UIComponent.extend("mycomp.Component", { 6 | "metadata": { 7 | "manifest": "json", 8 | }, 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '3.0' 2 | metadata: 3 | name: com.ui5.troublesome.app 4 | type: application 5 | framework: 6 | name: OpenUI5 7 | version: "1.121.0" 8 | libraries: 9 | - name: sap.m 10 | - name: sap.ui.core 11 | - name: sap.landvisz 12 | - name: themelib_sap_belize 13 | - name: themelib_sap_bluecrystal 14 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_cond_iife.js: -------------------------------------------------------------------------------- 1 | (function (factory) { 2 | if (sap.ui.define) { 3 | sap.ui.define( 4 | [ 5 | "sap/ui/core/mvc/Controller", 6 | "sap/ui/core/UIComponent", 7 | "sap/ui/core/routing/History", 8 | ], 9 | factory 10 | ); 11 | } 12 | })(function (Controller) { 13 | return Controller.extend("MyController", {}); 14 | }); 15 | -------------------------------------------------------------------------------- /resources/types/jquery.sap.mobile.d.ts: -------------------------------------------------------------------------------- 1 | interface JQueryStatic { 2 | /** 3 | * Holds information about the current operating system 4 | * 5 | * @deprecated since 1.20 use {@link sap.ui.Device.os} instead 6 | */ 7 | os: object; 8 | 9 | /** 10 | * @deprecated since 1.20 use the respective functions of {@link sap.ui.Device} instead 11 | */ 12 | device: object; 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/setTheme_Deprecations.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/core/Theming" 3 | ], function(Theming) { 4 | Theming.setTheme("sap_belize"); // positive finding 5 | Theming.setTheme("sap_bluecrystal"); // positive finding 6 | Theming.setTheme("sap_hcb"); // positive finding 7 | Theming.setTheme("sap_horizon"); // negative finding 8 | }); 9 | 10 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/XMLFragmentWithLowerCaseControl.fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/PrototypeClass.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/table/Table"], function(Table) { 2 | function MyClass() { 3 | } 4 | 5 | MyClass.prototype.initTable = function() { 6 | this.table = new Table(); 7 | }; 8 | 9 | MyClass.prototype.doSomething = function() { 10 | this.table.clone().setVisibleRowCount(5); 11 | }; 12 | 13 | return MyClass; 14 | }); 15 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_cond_iife_2.js: -------------------------------------------------------------------------------- 1 | (function (factory) { 2 | if (sap && sap.ui && sap.ui.define) { 3 | sap.ui.define( 4 | [ 5 | "sap/ui/core/mvc/Controller", 6 | "sap/ui/core/UIComponent", 7 | "sap/ui/core/routing/History", 8 | ], 9 | factory 10 | ); 11 | } 12 | })(function (Controller) { 13 | return Controller.extend("MyController", {}); 14 | }); 15 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/ui5lint-custom-broken.config.cjs: -------------------------------------------------------------------------------- 1 | // CodeQL code scan complains about this file being broken. 2 | // This is a case we test for the config manager. So, wrapping it in a JSON.parse to avoid the error there, 3 | // but keep the test case valid. 4 | module.exports = JSON.parse(`{ 5 | "ignores": [ 6 | "test/**/*", 7 | "!test/sap/m/visual/Wizard.spe`); 8 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_FunctionDeclarationMultipleReturns.js: -------------------------------------------------------------------------------- 1 | function factory(Controller, someModule) { 2 | const MyController = Controller.extend("MyController", {}); 3 | 4 | if (someModule) { 5 | return true; 6 | } else { 7 | return false; 8 | } 9 | } 10 | 11 | sap.ui.define( 12 | [ 13 | "sap/ui/core/mvc/Controller", 14 | "some/module" 15 | ], 16 | factory 17 | ); 18 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/configs/ui5-custom.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '4.0' 2 | metadata: 3 | name: com.ui5.troublesome.app 4 | type: application 5 | framework: 6 | name: OpenUI5 7 | version: "1.121.0" 8 | libraries: 9 | - name: sap.m 10 | - name: sap.ui.core 11 | - name: sap.landvisz 12 | resources: 13 | configuration: 14 | paths: 15 | webapp: webapp2 -------------------------------------------------------------------------------- /test/fixtures/linter/projects/library.with.custom.paths/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "3.2" 2 | type: library 3 | metadata: 4 | name: library.with.custom.paths 5 | resources: 6 | configuration: 7 | paths: 8 | src: "src/main/js" 9 | test: "src/test/js" 10 | framework: 11 | name: OpenUI5 12 | version: "1.120.6" 13 | libraries: 14 | - name: sap.ui.core 15 | - name: sap.landvisz 16 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.core/src/sap/ui/base/ManagedObject.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["./EventProvider"], function(EventProvider) { 2 | "use strict"; 3 | var ManagedObject = EventProvider.extend("sap.ui.base.ManagedObject", { 4 | metadata : { 5 | "abstract" : true, 6 | library : "sap.ui.core", // UI Library that contains this class 7 | }, 8 | }); 9 | return ManagedObject; 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_09/Component.ts: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // TypeScript component which inherits from ParentComponent which implements IAsyncContentCreation interface 3 | import ParentComponent from "mycomp/subdir/ParentComponent"; 4 | 5 | export default class Component extends ParentComponent { 6 | static metadata = { 7 | manifest: "json", 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /src/linter/ui5Types/fix/XmlEnabledFix.ts: -------------------------------------------------------------------------------- 1 | import {Attribute, Position, Tag} from "sax-wasm"; 2 | import Fix from "./Fix.js"; 3 | 4 | export type SaxNodeTypes = Tag | Attribute; 5 | export type ToPositionCallback = (pos: Position) => number; 6 | 7 | export default abstract class XmlEnabledFix extends Fix { 8 | abstract visitAutofixXmlNode(node: SaxNodeTypes, toPosition: ToPositionCallback): boolean; 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/thirdparty/topLevelCode.js: -------------------------------------------------------------------------------- 1 | // This file ensures that checks for top-level code work correctly 2 | 3 | Object.defineProperty(exports, "__esModule", { value: true }); 4 | exports.Foo = void 0; 5 | 6 | class Foo { 7 | doSomething() { 8 | return true; 9 | } 10 | } 11 | 12 | exports.class = Foo; 13 | exports.instance = new Foo(); 14 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_01/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // No IAsyncContentCreation interface is implemented, no async flags in manifest.json 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_13/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Manifest v2 with async: false in rootView - should trigger MANIFEST_ASYNC_FALSE_ERROR 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_14/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Manifest v2 with async: true in rootView - should trigger MANIFEST_V2_ASYNC_FLAG_ERROR 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_15/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Manifest v1 with async: false in rootView - should trigger MANIFEST_ASYNC_FALSE_ERROR 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Export_Object.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/model/json/JSONModel", "sap/ui/model/BindingMode", "sap/ui/Device"], function (JSONModel, BindingMode, Device) { 2 | "use strict"; 3 | 4 | return { 5 | createDeviceModel: function () { 6 | var oModel = new JSONModel(Device); 7 | oModel.setDefaultBindingMode(BindingMode.OneWay); 8 | return oModel; 9 | } 10 | }; 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.f/src/sap/f/ProductSwitchRenderer.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(function () { 2 | "use strict"; 3 | return { 4 | apiVersion: 1, // Reported: apiVersion property must be present and to have value 2 5 | render: function (oRm, oControl) { 6 | // Reported: IconPool is NOT declared as dependency 7 | oRm.icon("sap-icon://appointment", null, { title: null }); 8 | } 9 | }; 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_07/Component.js: -------------------------------------------------------------------------------- 1 | // Inheriting from sap/fe/core/AppComponent (implements IAsyncContentCreation interface), no redundant async flags in manifest 2 | sap.ui.define(["sap/fe/core/AppComponent"], function (Component) { 3 | "use strict"; 4 | 5 | return Component.extend("mycomp.Component", { 6 | metadata: { 7 | manifest: "json", 8 | }, 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_16/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Manifest v2 with async: false in routing.config - should trigger MANIFEST_ASYNC_FALSE_ERROR 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/XMLViewNamespacePrefix.view.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_05/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Async flags are maintained in manifest.json. Inheriting from parent component. 3 | sap.ui.define(["mycomp/subdir/ParentComponent"], function (ParentComponent) { 4 | "use strict"; 5 | 6 | return ParentComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_11/Component.js: -------------------------------------------------------------------------------- 1 | // Component which does not inherit from UIComponent: 2 | // IAsyncContentCreation / rootView / routing should not be analyzed 3 | sap.ui.define(["sap/ui/core/Component"], function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("mycomp.Component", { 7 | "metadata": { 8 | "manifest": "json", 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_07/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // No IAsyncContentCreation interface is implemented, no async flag (rootView only) in manifest.json 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json" 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_08/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // No IAsyncContentCreation interface is implemented, no async flag (routing only) in manifest.json 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | manifest: "json" 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/Configuration.beforeBootstrap.qunit.js: -------------------------------------------------------------------------------- 1 | // This file was a False Positive for the new Test Starter detections. 2 | 3 | window["sap-ui-config"] = { 4 | theme: "SapSampleTheme2", // This should not get detected by the Test Starter detections 5 | language: "en", 6 | calendarType: "islamic", 7 | logLevel: "WARNING", 8 | noConflict: "true", 9 | libs: "sap.ui.core" 10 | }; 11 | -------------------------------------------------------------------------------- /.licensee.json: -------------------------------------------------------------------------------- 1 | { 2 | "licenses": { 3 | "spdx": [ 4 | "CC-BY-3.0", 5 | "CC-BY-4.0", 6 | "BSD" 7 | ], 8 | "blueOak": "bronze" 9 | }, 10 | "packages": { 11 | "@sapui5/types": "*", 12 | "callsite": "1.0.0", 13 | "deep-freeze-strict": "1.1.1", 14 | "yesno": "0.4.0", 15 | "map-stream": "0.1.0", 16 | "pause-stream": "0.0.11" 17 | }, 18 | "corrections": true 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Factory_VarDeclarationFunctionExpressionMultipleReturns.js: -------------------------------------------------------------------------------- 1 | const factory = function (Controller, someModule) { 2 | const MyController = Controller.extend("MyController", {}); 3 | 4 | if (someModule) { 5 | return true; 6 | } else { 7 | return false; 8 | } 9 | }; 10 | 11 | sap.ui.define( 12 | [ 13 | "sap/ui/core/mvc/Controller", 14 | "some/module" 15 | ], 16 | factory 17 | ); 18 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/Directives/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '4.0' 2 | metadata: 3 | name: openui5-sample-app 4 | type: application 5 | framework: 6 | name: OpenUI5 7 | version: "1.130.0" 8 | libraries: 9 | # ui5lint-disable-next-line -- This is a comment 10 | - name: sap.ui.commons 11 | - name: sap.ui.core 12 | - name: themelib_sap_horizon 13 | - name: themelib_sap_belize # ui5lint-disable-line 14 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Require_Callback.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | return { 3 | renderButton() { 4 | var msg = "Tapped"; 5 | sap.ui.require(["sap/m/Button"], (Button) => { 6 | new Button({ 7 | tap: () => console.log(msg) // Event "tap" is deprecated 8 | }).placeAt("button"); 9 | }); 10 | }, 11 | renderInput() { 12 | console.log(`Not implemented`); 13 | } 14 | }; 15 | }); 16 | -------------------------------------------------------------------------------- /src/linter/MessageArgs.ts: -------------------------------------------------------------------------------- 1 | import type {MESSAGE_INFO} from "./messages.js"; 2 | 3 | type ExtractArgs = F extends (args: infer P) => unknown ? P : never; 4 | type CombineArgs = M & D extends object ? M & D : never; 5 | 6 | export type MessageArgs = { 7 | [K in keyof typeof MESSAGE_INFO]: 8 | CombineArgs< 9 | ExtractArgs, ExtractArgs 10 | >; 11 | }; 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/setTheme_Deprecations.ts: -------------------------------------------------------------------------------- 1 | import Theming from "sap/ui/core/Theming"; 2 | 3 | export default class SetThemeController { 4 | init(): void { 5 | Theming.setTheme("sap_belize"); // positive finding 6 | Theming.setTheme("sap_bluecrystal"); // positive finding 7 | Theming.setTheme("sap_hcb"); // positive finding 8 | Theming.setTheme("sap_horizon"); // negative finding 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/model/models.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/model/json/JSONModel", "sap/ui/model/BindingMode", "sap/ui/Device"], function (JSONModel, BindingMode, Device) { 2 | "use strict"; 3 | 4 | return { 5 | createDeviceModel: function () { 6 | var oModel = new JSONModel(Device); 7 | oModel.setDefaultBindingMode(BindingMode.OneWay); 8 | return oModel; 9 | } 10 | }; 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.ui.suite/test/sap/ui/suite/qunit/TaskCircle.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/suite/TaskCircle", 3 | "sap/m/DateTimeInput" 4 | ], function(TaskCircle, DateTimeInput) { 5 | "use strict"; 6 | // The linter used to only detect the DateTimeInput deprecation in this file. 7 | // It has been solved via https://github.com/UI5/linter/pull/290. 8 | // This test ensures that it continues to work. 9 | }); 10 | -------------------------------------------------------------------------------- /src/linter/ui5Types/amdTranspiler/util.ts: -------------------------------------------------------------------------------- 1 | import ts from "typescript"; 2 | 3 | export function toPosStr(node: ts.Node) { 4 | const {line, character: column} = node.getSourceFile().getLineAndCharacterOfPosition(node.getStart()); 5 | return `${line + 1}:${column + 1}`; 6 | } 7 | 8 | export class UnsupportedModuleError extends Error { 9 | constructor(message: string) { 10 | super(message); 11 | this.name = this.constructor.name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/autofix/ambiguousEventHandlers/Base.controller.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/mvc/Controller"], function (Controller) { 2 | "use strict"; 3 | 4 | return Controller.extend("ui5.walkthrough.controller.Base", { 5 | baseEventHandlers: { 6 | oneLevelDeeper: { 7 | onPressButton: this.onBaseControllerHandler, 8 | }, 9 | }, 10 | 11 | onBaseControllerHandler: function () { 12 | // Handler logic 13 | } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_06/Component.js: -------------------------------------------------------------------------------- 1 | // IAsyncContentCreation interface is implemented, no redundant async flags in inline manifest of parent component 2 | sap.ui.define(["mycomp/subdir/ParentComponent"], function (ParentComponent) { 3 | "use strict"; 4 | 5 | return ParentComponent.extend("mycomp.Component", { 6 | metadata: { 7 | interfaces: ["sap.ui.core.IAsyncContentCreation"], 8 | }, 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | window.suite = function () { 3 | var suite = new parent.jsUnitTestSuite(); 4 | var aParts = location.pathname.match(/(.*\/)(?:[^/]+)/); 5 | var sContextPath = aParts && aParts[1]; 6 | suite.addTestPage(sContextPath + "unit/unitTests.qunit.html"); 7 | suite.addTestPage(sContextPath + "integration/opaTests.qunit.html"); 8 | return suite; 9 | }; 10 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/XMLFragmentEmbeddedFragDef.fragment.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ava.config.js: -------------------------------------------------------------------------------- 1 | const nodeArguments = [ 2 | "--import=tsx/esm", 3 | "--no-warnings=ExperimentalWarning", 4 | ]; 5 | 6 | export default { 7 | extensions: { 8 | ts: "module", 9 | }, 10 | files: [ 11 | "test/lib/**/*.ts", 12 | ], 13 | watchMode: { 14 | ignoreChanges: [ 15 | "test/tmp/**", 16 | "lib/**", 17 | ], 18 | }, 19 | nodeArguments, 20 | workerThreads: false, 21 | timeout: "20s", // Increased timeout for slower CI environments 22 | }; 23 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_02/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // IAsyncContentCreation interface is implemented, redundant async flags in manifest.json 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | interfaces: ["sap.ui.core.IAsyncContentCreation"], 9 | manifest: "json", 10 | }, 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_20/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // Inline Manifest v2 with async: false flags (should trigger MANIFEST_ASYNC_FALSE_ERROR) 3 | sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) { 4 | "use strict"; 5 | 6 | return UIComponent.extend("mycomp.Component", { 7 | metadata: { 8 | "interfaces": ["sap.ui.core.IAsyncContentCreation"], 9 | manifest: "json", 10 | } 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoGlobals/NoImplicitGlobalsOData.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Text"], (Text) => { 2 | const oText1 = new Text({ 3 | text: "{= odata.compare(%{myvalue1},%{myvalue2})}" 4 | }); 5 | const oText2 = new Text({ 6 | text: "{= odata.fillUriTemplate(${myvalue1},${myvalue2})}" 7 | }); 8 | oText2.applySettings({ 9 | text: "{= odata.uriEncode(%{myvalue1},'Edm.String') + ' - ' + odata.uriEncode(%{myvalue2},'Edm.String') }" 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/renderer/7ControlRenderer.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function () { 2 | var myControlRenderer = { 3 | apiVersion: 1, 4 | }; 5 | myControlRenderer.render = function (oRm, oMyControl) { 6 | oRm.openStart("div", oMyControl); 7 | // Reported- IconPool is NOT declared as dependency 8 | oRm.icon("sap-icon://appointment", null, { title: null }); 9 | oRm.openEnd(); 10 | oRm.close("div"); 11 | }; 12 | return myControlRenderer; 13 | }); 14 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/sap.f/test/sap/f/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit test suite for Todo App 6 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_05/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // IAsyncContentCreation interface is implemented, redundant async flags in manifest of parent component 3 | sap.ui.define(["mycomp/subdir/ParentComponent"], function (ParentComponent) { 4 | "use strict"; 5 | 6 | return ParentComponent.extend("mycomp.Component", { 7 | metadata: { 8 | interfaces: ["sap.ui.core.IAsyncContentCreation"], 9 | }, 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoGlobals/ModelDataTypes_NewVarTypeNegative.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/m/Input", "sap/ui/model/type/Integer"], 3 | (Input, Integer) => { 4 | "use strict"; 5 | 6 | const intType = new Integer( 7 | { minIntegerDigits: 3 }, // format options 8 | { maximum: 1000 } // constraint 9 | ); 10 | const input = new Input({ 11 | value: { 12 | path: "/names/0/amount", 13 | type: intType, 14 | }, 15 | }); 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | name: Commit Message Linting 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | permissions: 12 | contents: read 13 | pull-requests: read 14 | 15 | jobs: 16 | commitlint: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v6 20 | with: 21 | fetch-depth: 0 22 | - uses: wagoid/commitlint-github-action@v6 23 | -------------------------------------------------------------------------------- /test/fixtures/autofix/sapMApi/SapM.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Button"], function(Button) { 2 | const btn = new Button({ 3 | tap: function() {} // Deprecated class property tap should be replaced 4 | }); 5 | btn.attachTap(function() {}); // Deprecated method attachTap should be replaced 6 | btn.detachTap(function() {}); 7 | const btn = new Button({ 8 | tap: function() {}, // Do not replace since "press" is already defined 9 | press: function() {} 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/BootstrapParameters_Deprecations4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Declarative Programming for SAPUI5 5 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoDeprecatedApi/BootstrapParameters_Deprecations5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Declarative Programming for SAPUI5 5 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoGlobals/ModelDataTypes_BindPropertyVarTypeNegative.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/m/Input", "sap/ui/model/type/Integer"], 3 | (Input, Integer) => { 4 | "use strict"; 5 | 6 | const intType = new Integer( 7 | { minIntegerDigits: 2 }, // format options 8 | { maximum: 1000 } // constraint 9 | ); 10 | const input = new Input(); 11 | 12 | input.bindProperty("value", { 13 | path: "/age", 14 | type: intType, 15 | }); 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /.github/workflows/reuse-compliance.yml: -------------------------------------------------------------------------------- 1 | name: REUSE 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | # No permissions are required for this workflow 12 | permissions: {} 13 | 14 | jobs: 15 | compliance-check: 16 | name: Compliance Check 17 | runs-on: ubuntu-24.04 18 | steps: 19 | - uses: actions/checkout@v6 20 | - name: Execute REUSE Compliance Check 21 | uses: fsfe/reuse-action@v6 22 | -------------------------------------------------------------------------------- /test/fixtures/autofix/ODataModelV4.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/model/odata/v4/ODataModel", 3 | ], function(ODataModel) { 4 | var model = new ODataModel({ 5 | serviceUrl: "/odata/v4/service", 6 | synchronizationMode: "None" // Parameter "synchronizationMode" is deprecated since 1.110 7 | }); 8 | var model = new ODataModel({ 9 | serviceUrl: "/odata/v4/service", 10 | /* Parameter "synchronizationMode" is deprecated since 1.110 */ "synchronizationMode": true 11 | }); 12 | }); -------------------------------------------------------------------------------- /test/fixtures/autofix/ambiguousEventHandlers/appA/view/User.view.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/linter/ui5Types/fix/collections/sapUiCompFixes.ts: -------------------------------------------------------------------------------- 1 | import Ui5TypeInfoMatcher from "../../Ui5TypeInfoMatcher.js"; 2 | import { 3 | FixTypeInfoMatcher, 4 | propertyAssignmentFix, 5 | } from "../FixFactory.js"; 6 | 7 | const t: FixTypeInfoMatcher = new Ui5TypeInfoMatcher("sap.ui.comp"); 8 | export default t; 9 | 10 | t.declareModule("sap/ui/comp/smarttable/SmartTable", [ 11 | t.managedObjectSetting("$SmartTableSettings", [ 12 | // Property "useExportToExcel" => "enableExport" 13 | t.metadataProperty("useExportToExcel", propertyAssignmentFix({ 14 | property: "enableExport", 15 | })), 16 | ]), 17 | ]); 18 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsNotFixable.js: -------------------------------------------------------------------------------- 1 | // Assignments to global variables should not be fixed/replaced 2 | sap.ui.define([], function() { 3 | 4 | // Declaring globals might appear in tests 5 | window.sap.ushell = {}; 6 | // Assignments can be with or without window prefix 7 | sap.ushell.Container = { 8 | getService: function() { 9 | return {}; 10 | } 11 | }; 12 | 13 | // Delete can't be fixed in case the module export is deleted 14 | delete sap.ushell.Container; 15 | 16 | // Deleting an inner property of a global module access can be fixed 17 | delete sap.ushell.Container.getService; 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/renderer/1Control.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/Control", "sap/ui/core/IconPool"], function (Control) { 2 | var myControl = Control.extend("mycomp.myControl", { 3 | metadata: {}, 4 | renderer: { 5 | "apiVersion": 1, // Deprecated 6 | render: function (oRm, oMyControl) { 7 | oRm.openStart("div", oMyControl); 8 | oRm.class("mycssclass"); 9 | oRm.icon("sap-icon://appointment", null, { title: null }); // Not an issue- IconPool is declared as dependency 10 | oRm.openEnd(); 11 | oRm.close("div"); 12 | }, 13 | }, 14 | }); 15 | 16 | return myControl; 17 | }); 18 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | ### Support 2 | 3 | If you need help setting something up, or if you have questions regarding UI5 linter, please refrain from opening an issue on GitHub. 4 | 5 | Instead, please use one of the following platforms to seek help: 6 | 7 | * [StackOverflow](http://stackoverflow.com/questions/tagged/ui5-tooling) 8 | * The [`#tooling`](https://openui5.slack.com/archives/C0A7QFN6B) channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com). 9 | 10 | If you want to report an issue or request a new feature, please follow our [Contribution Guidelines](./CONTRIBUTING.md#-feature-requests). 11 | -------------------------------------------------------------------------------- /test/fixtures/autofix/bootstrapParameters/BootstrapParameters_CompatVersion4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sample index.html with compat-version=edge -> binding-syntax attributes w/ complex should be removed 5 | 6 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsNoModules.js: -------------------------------------------------------------------------------- 1 | const avatarDOM = jQuery("#container-todo---app--avatar-profile"); 2 | const list = sap.ui.getCore().byId("container-todo---app--todoList"); 3 | const button = new sap.m.Button({ 4 | text: "Hello", 5 | }); 6 | const button3 = new window.sap.m.Button({ 7 | text: "Hello", 8 | }); 9 | const fileUploader = new sap.ui.unified.FileUploader({ 10 | valueState: sap.ui.core.ValueState.Success 11 | }); 12 | const core = sap.ui.core; 13 | const fileUploader2 = new sap.ui.unified.FileUploader({ 14 | valueState: core.ValueState.Success 15 | }); 16 | sap.ui.view("myView"); 17 | sap.m.URLHelper.triggerSms(); 18 | -------------------------------------------------------------------------------- /test/lib/linter/messages.ts: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import {RULES} from "../../../src/linter/messages.js"; 3 | import {readFile} from "node:fs/promises"; 4 | 5 | const rules = Object.keys(RULES); 6 | const rulesMd = await readFile(new URL("../../../docs/Rules.md", import.meta.url), {encoding: "utf-8"}); 7 | 8 | rules.forEach((rule) => { 9 | test.serial(`Check documentation of '${rule}' in docs/Rules.md`, (t) => { 10 | t.true(rulesMd.includes(`\n## ${rule}\n`), 11 | `Heading exists in docs/Rules.md`); 12 | t.true(rulesMd.includes(`- [${rule}](#${rule})`), 13 | `Table of contents entry exists in docs/Rules.md`); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Thank you for your contribution!** 🙌 2 | 3 | To get it merged faster, kindly review the checklist below: 4 | 5 | ## Pull Request Checklist 6 | - [ ] Reviewed the [Contributing Guidelines](https://github.com/UI5/linter/blob/main/CONTRIBUTING.md#-contributing-code) 7 | + Especially the [How to Contribute](https://github.com/UI5/linter/blob/main/CONTRIBUTING.md#how-to-contribute) section 8 | - [ ] [No merge commits](https://github.com/UI5/linter/blob/main/docs/Guidelines.md#no-merge-commits) 9 | - [ ] [Correct commit message style](https://github.com/UI5/linter/blob/main/docs/Guidelines.md#commit-message-style) 10 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoGlobals/NoExportedLibValues.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/ui/unified/library", "sap/ui/core/library"], 3 | function (unifiedLibrary, coreLibrary) { 4 | "use strict"; 5 | 6 | var CalendarDayType = unifiedLibrary.CalendarDayType, 7 | DateRange = unifiedLibrary["DateRange"], 8 | DateRange2 = unifiedLibrary['DateRange'], 9 | DateTypeRange = unifiedLibrary.DateTypeRange, 10 | DOMAttribute = coreLibrary.tmpl.DOMAttribute, 11 | DOMAttribute2 = coreLibrary["tmpl"].DOMAttribute, 12 | DOMAttribute3 = coreLibrary['tmpl']["DOMAttribute"], 13 | DOMAttribute4 = coreLibrary.tmpl['DOMAttribute']; 14 | } 15 | ); 16 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Ui5ClassWithMetadata.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/base/Object", "sap/ui/base/Metadata"], function(BaseObject, Metadata) { 2 | "use strict"; 3 | 4 | const MyClassMetadata = function(sClassName, oClassInfo) { 5 | // call super constructor 6 | Metadata.apply(this, arguments); 7 | }; 8 | // chain the prototypes 9 | MyClassMetadata.prototype = Object.create(Metadata.prototype); 10 | MyClassMetadata.prototype.constructor = MyClassMetadata; 11 | 12 | const MyClass = BaseObject.extend("my.MyClass", { 13 | myFunction() { 14 | return "Hello World"; 15 | } 16 | }, MyClassMetadata); 17 | return MyClass; 18 | }); 19 | -------------------------------------------------------------------------------- /resources/types/pseudo-modules/sap.ui.vtm.d.ts: -------------------------------------------------------------------------------- 1 | // This file is generated by the createTypes script. 2 | 3 | declare module "sap/ui/vtm/Matrix" { 4 | import {Matrix} from "sap/ui/vtm/library"; 5 | 6 | /** 7 | * A float[] type representing a transformation matrix in a ISO 10303-42 format (in a 1 dimensional array of 13 numbers). 8 | * 9 | * The {@link sap.ui.vtm.MatrixComponent} enumeration enumerates the array indices of the matrix components for this type 10 | * 11 | * @experimental (since 1.0.0) - This class is experimental and might be modified or removed in future versions. 12 | * @public 13 | */ 14 | export default Matrix; 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/e2e/runtime/test/qunit/jQuery.sap.pad.qunit.js: -------------------------------------------------------------------------------- 1 | /*global QUnit */ 2 | sap.ui.define(() => { 3 | "use strict"; 4 | 5 | QUnit.module("jQuery.sap.pad"); 6 | 7 | QUnit.test("jQuery.sap.padLeft", function (assert) { 8 | assert.equal(jQuery.sap.padLeft("a", "123", 5), "123123a"); 9 | const padChar = "123"; 10 | assert.equal(jQuery.sap.padLeft("a", padChar, 5), "123123a"); 11 | }); 12 | 13 | QUnit.test("jQuery.sap.padRight", function (assert) { 14 | assert.equal(jQuery.sap.padRight("a", "123", 5), "a123123"); 15 | const padChar = "123"; 16 | assert.equal(jQuery.sap.padRight("a", padChar, 5), "a123123"); 17 | }); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/amd/Ui5Bundle.js: -------------------------------------------------------------------------------- 1 | //@ui5-bundle com/ui5/troublesome/app/bundles/ui5-bundle-without-sourcemap.js 2 | jQuery.sap.registerPreloadedModules({ 3 | "version": "2.0", 4 | "modules": { 5 | "com/ui5/troublesome/app/Component.js": function () { 6 | sap.ui.define(["sap/ui/Device"], function () { 7 | return sap.ui.core.UIComponent.extend("com.ui5.troublesome.app.Component", { 8 | metadata: { 9 | manifest: "json" 10 | } 11 | }); 12 | }); 13 | } 14 | } 15 | }); 16 | 17 | // This file should be excluded from linting as it is a UI5 bundle file. 18 | // It should also not be transformed by the amdTranspiler. 19 | -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@istanbuljs/nyc-config-typescript", 3 | "reporter": ["lcov", "text", "text-summary"], 4 | "include": ["src/**"], 5 | "exclude": [ 6 | "src/cli/middlewares/updateNotifier.ts", 7 | "src/cli/utils/profile.ts", 8 | "src/linter/xmlTemplate/lib/JSTokenizer.js", 9 | "src/linter/binding/lib/**/*.js", 10 | "**/*.d.ts" 11 | ], 12 | "check-coverage": true, 13 | "statements": 89, 14 | "branches": 82, 15 | "functions": 95, 16 | "lines": 89, 17 | "watermarks": { 18 | "statements": [70, 90], 19 | "branches": [70, 90], 20 | "functions": [70, 90], 21 | "lines": [70, 90] 22 | }, 23 | "cache": true, 24 | "all": true 25 | } 26 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Positive_11/Component.ts: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // TypeScript component which does not implement IAsyncContentCreation interface, no async flags in manifest.json 3 | // Also, usage of deprecated type in properties should be reported 4 | import UIComponent from "sap/ui/core/UIComponent"; 5 | 6 | export default class Component extends UIComponent { 7 | constructor() { 8 | super("my.comp.Component"); 9 | } 10 | 11 | static metadata = { 12 | "properties": { 13 | // Usage of deprecated type 14 | propertyWithDeprecatedType: { 15 | type: "sap.m.DateTimeInputType" 16 | }, 17 | } 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/autofix/ambiguousEventHandlers/MainTs.controller.ts: -------------------------------------------------------------------------------- 1 | import BaseController from "./BaseTs.controller.js"; 2 | import type Event from "sap/ui/base/Event"; 3 | 4 | /** 5 | * @namespace ui5.walkthrough.controller 6 | */ 7 | export default class MainTs extends BaseController { 8 | 9 | public eventHandlers = { 10 | onPressFancyButton: this.onPressFancyButton.bind(this), 11 | }; 12 | 13 | public onPressFancyButton(oEvent: Event): void { 14 | console.log("Fancy button pressed", oEvent); 15 | } 16 | 17 | public onPressFancyButtonArrow = (oEvent: Event): void => { 18 | console.log("Fancy button pressed from arrow function", oEvent); 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/e2e.yml: -------------------------------------------------------------------------------- 1 | name: End-To-End Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | workflow_dispatch: 11 | 12 | # No permissions are required for this workflow 13 | permissions: {} 14 | 15 | jobs: 16 | e2e: 17 | runs-on: ubuntu-24.04 18 | steps: 19 | - name: Checkout repository 20 | uses: actions/checkout@v6 21 | 22 | - name: Use Node.js 20.11.0 23 | uses: actions/setup-node@v6 24 | with: 25 | node-version: 20.11.0 26 | 27 | - name: Install dependencies 28 | run: npm ci 29 | 30 | - name: Run e2e tests 31 | run: npm run e2e 32 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/NoGlobals/NoImplicitGlobalsOData_Negative.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/m/Text", "sap/ui/model/odata/ODataExpressionAddons"], (Text) => { 2 | const oText1 = new Text({ 3 | text: "{= odata.compare(%{myvalue1},%{myvalue2})}" 4 | }); 5 | const oText2 = new Text({ 6 | text: "{= odata.fillUriTemplate(${myvalue1},${myvalue2})}" 7 | }); 8 | oText2.applySettings({ 9 | text: "{= odata.uriEncode(%{myvalue1},'Edm.String') + ' - ' + odata.uriEncode(%{myvalue2},'Edm.String') }" 10 | }); 11 | oText2.applySettings({ 12 | text: `\\{"foo": "bar"}` // Escaped JSON string should not cause issues when checking for odata globals within a binding 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/AsyncComponentFlags/Negative_01/Component.js: -------------------------------------------------------------------------------- 1 | // Fixture description: 2 | // - IAsyncContentCreation interface is implemented, no redundant async flags in manifest.json 3 | // - Component module contains additional local class (MyType) that does not inherit from the UI5 Component 4 | sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/model/type/Unit"], function (UIComponent, UnitType) { 5 | "use strict"; 6 | 7 | const MyType = UnitType.extend("mycomp.MyType", {}); 8 | 9 | return UIComponent.extend("mycomp.Component", { 10 | metadata: { 11 | "interfaces": ["sap.ui.core.IAsyncContentCreation"], 12 | "manifest": "json", 13 | }, 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/Directives/Directives3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OpenUI5 Todo App 7 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/linter/manifestJson/linter.ts: -------------------------------------------------------------------------------- 1 | import {Resource} from "@ui5/fs"; 2 | import ManifestLinter from "./ManifestLinter.js"; 3 | import {taskStart} from "../../utils/perf.js"; 4 | import {LinterParameters} from "../LinterContext.js"; 5 | 6 | export default async function lintJson({filePathsWorkspace, context}: LinterParameters) { 7 | const lintingDone = taskStart("Linting manifest.json files"); 8 | const jsonResources = await filePathsWorkspace.byGlob("**/manifest.json"); 9 | 10 | await Promise.all(jsonResources.map(async (resource: Resource) => { 11 | const linter = new ManifestLinter(resource.getPath(), await resource.getString(), context); 12 | await linter.lint(); 13 | })); 14 | lintingDone(); 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/autofix/bootstrapParameters/BootstrapParameters_CompatVersion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sample index.html with compat-version=edge -> binding-syntax attributes w/ complex should be removed 5 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/bundles/ui5-bundle-without-sourcemap.js: -------------------------------------------------------------------------------- 1 | //@ui5-bundle com/ui5/troublesome/app/bundles/ui5-bundle-without-sourcemap.js 2 | jQuery.sap.registerPreloadedModules({ 3 | "version": "2.0", 4 | "modules": { 5 | "com/ui5/troublesome/app/Component.js": function () { 6 | sap.ui.define(["sap/ui/Device"], function () { 7 | return sap.ui.core.UIComponent.extend("com.ui5.troublesome.app.Component", { 8 | metadata: { 9 | manifest: "json" 10 | } 11 | }); 12 | }); 13 | } 14 | } 15 | }); 16 | 17 | // This file should be excluded from linting as it is a UI5 bundle file. 18 | // It should also not be transformed by the amdTranspiler. 19 | -------------------------------------------------------------------------------- /test/fixtures/autofix/Core.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(["sap/ui/core/Core",], function(Core) { 2 | Core.applyTheme("themeName"); 3 | Core.applyTheme("customTheme", "find/my/theme/here"); // Should not be autofixed if there is a 2nd argument 4 | Core.applyTheme("customTheme", undefined); // Can be migrated when the 2nd argument is undefined 5 | 6 | Core.attachInit(function() {console.log();}); 7 | 8 | Core.attachInitEvent(function() {console.log();}); 9 | 10 | Core.attachIntervalTimer(function() { 11 | Core.applyTheme("themeName"); 12 | }); 13 | Core.attachIntervalTimer(function() { 14 | Core.applyTheme("themeName"); 15 | }, {}); // Should not be autofixed if there is a 2nd argument 16 | 17 | Core.byId("id"); 18 | }); -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithoutDeps_ArrowFunction.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(() => { 2 | const avatarDOM = jQuery("#container-todo---app--avatar-profile"); 3 | const list = sap.ui.getCore().byId("container-todo---app--todoList"); 4 | const button = new sap.m.Button({ 5 | text: "Hello" 6 | }); 7 | const button2 = new window.sap.m.Button({ 8 | text: "Hello" 9 | }); 10 | const fileUploader = new sap.ui.unified.FileUploader({ 11 | valueState: sap.ui.core.ValueState.Success 12 | }); 13 | const core = sap.ui.core; 14 | const fileUploader2 = new sap.ui.unified.FileUploader({ 15 | valueState: core.ValueState.Success 16 | }); 17 | sap.ui.view("myView"); 18 | sap.m.URLHelper.triggerSms(); 19 | }); 20 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithoutDeps_EmptyArray.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function() { 2 | const avatarDOM = jQuery("#container-todo---app--avatar-profile"); 3 | const list = sap.ui.getCore().byId("container-todo---app--todoList"); 4 | const button = new sap.m.Button({ 5 | text: "Hello" 6 | }); 7 | const button2 = new window.sap.m.Button({ 8 | text: "Hello" 9 | }); 10 | const fileUploader = new sap.ui.unified.FileUploader({ 11 | valueState: sap.ui.core.ValueState.Success 12 | }); 13 | const core = sap.ui.core; 14 | const fileUploader2 = new sap.ui.unified.FileUploader({ 15 | valueState: core.ValueState.Success 16 | }); 17 | sap.ui.view("myView"); 18 | sap.m.URLHelper.triggerSms(); 19 | }); 20 | -------------------------------------------------------------------------------- /test/fixtures/autofix/ambiguousEventHandlers/BaseTs.controller.ts: -------------------------------------------------------------------------------- 1 | import Controller from "sap/ui/core/mvc/Controller"; 2 | 3 | /** 4 | * @namespace ui5.walkthrough.controller 5 | */ 6 | export default class BaseTs extends Controller { 7 | 8 | public baseEventHandlers: { 9 | oneLevelDeeper: { 10 | onPressButton: () => void; 11 | }; 12 | }; 13 | 14 | constructor(sName: string) { 15 | super(sName); 16 | 17 | // Initialize after super() to ensure 'this' is properly bound 18 | this.baseEventHandlers = { 19 | oneLevelDeeper: { 20 | onPressButton: this.onBaseControllerHandler.bind(this), 21 | }, 22 | }; 23 | } 24 | 25 | public onBaseControllerHandler(): void { 26 | // Handler logic 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineTooManyArgs.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([], function () { 2 | const avatarDOM = jQuery("#container-todo---app--avatar-profile"); 3 | const list = sap.ui.getCore().byId("container-todo---app--todoList"); 4 | const button = new sap.m.Button({ 5 | text: "Hello", 6 | }); 7 | const button3 = new window.sap.m.Button({ 8 | text: "Hello", 9 | }); 10 | const fileUploader = new sap.ui.unified.FileUploader({ 11 | valueState: sap.ui.core.ValueState.Success 12 | }); 13 | const core = sap.ui.core; 14 | const fileUploader2 = new sap.ui.unified.FileUploader({ 15 | valueState: core.ValueState.Success 16 | }); 17 | sap.ui.view("myView"); 18 | sap.m.URLHelper.triggerSms(); 19 | }, true, true, true); 20 | -------------------------------------------------------------------------------- /test/fixtures/autofix/bootstrapParameters/BootstrapParameters_CompatVersion2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sample index.html with compat-version=edge (+random order) -> binding-syntax attributes w/ complex should be removed 5 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/fixtures/linter/rules/Directives/Directives4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OpenUI5 Todo App 7 | 8 | 11 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /test/fixtures/autofix/GlobalsExistingDefineWithDeps_ManyGlobalsMultiLine.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/m/Dialog" 3 | ], function( 4 | Dialog 5 | ) { 6 | const dialog = new Dialog(); 7 | const combobox = new sap.m.ComboBox(); 8 | const input = new sap.m.Input(); 9 | const label = new sap.m.Label(); 10 | const list = new sap.m.List(); 11 | const panel = new sap.m.Panel(); 12 | const popover = new sap.m.Popover(); 13 | const select = new sap.m.Select(); 14 | const table = new sap.m.Table(); 15 | const text = new sap.m.Text(); 16 | const title = new sap.m.Title(); 17 | const uploadCollection = new sap.m.UploadCollection(); 18 | const viewSettingsDialog = new sap.m.ViewSettingsDialog(); 19 | const wizard = new sap.m.Wizard(); 20 | }); 21 | -------------------------------------------------------------------------------- /test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | QUnit test suite for the UI5 Application: com.ui5.troublesome.app 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/fixtures/transpiler/xml/XMLFragment.fragment.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 |