diff --git a/src/autofix/solutions/codeReplacer.ts b/src/autofix/solutions/codeReplacer.ts index 9f62d9e9f..c08161b21 100644 --- a/src/autofix/solutions/codeReplacer.ts +++ b/src/autofix/solutions/codeReplacer.ts @@ -314,6 +314,32 @@ function patchMessageFixHints(fixHints?: FixHints, apiName?: string) { `$moduleIdentifier.${fnName}(${cleanRedundantArguments(fixHints.exportCodeToBeUsed.args)})`; } } + } else if ([ + "setCalendarType", + "setCalendarWeekNumbering", + "setFormatLocale", + "setLanguage", + "setRTL", + "setTheme", + "setTimezone", + ].includes(apiName ?? "") && + [ + "sap/base/i18n/Formatting", + "sap/base/i18n/Localization", + "sap/ui/core/Theming", + ].includes(fixHints?.moduleName ?? "")) { + if (fixHints?.exportCodeToBeUsed.isExpectedValue) { + // API not compatible + fixHints = undefined; + log.verbose(`Autofix skipped for ${apiName}.`); + } else { + const fnName = apiName ?? ""; + if (fnName && fixHints && typeof fixHints.exportCodeToBeUsed === "object" && + fixHints.exportCodeToBeUsed.args) { + fixHints.exportCodeToBeUsed.name = + `$moduleIdentifier.${fnName}(${cleanRedundantArguments(fixHints.exportCodeToBeUsed.args)})`; + } + } } return fixHints; diff --git a/src/linter/ui5Types/SourceFileLinter.ts b/src/linter/ui5Types/SourceFileLinter.ts index 5697375c9..35f3de2ae 100644 --- a/src/linter/ui5Types/SourceFileLinter.ts +++ b/src/linter/ui5Types/SourceFileLinter.ts @@ -916,7 +916,8 @@ export default class SourceFileLinter { ts.isPropertyAccessExpression(exprNode) || ts.isCallExpression(exprNode)) { fixHints = this.getJquerySapFixHints(exprNode) ?? - this.getCoreFixHints(exprNode, deprecationInfo.ui5TypeInfo); + this.getCoreFixHints(exprNode, deprecationInfo.ui5TypeInfo) ?? + this.getConfigFixHints(exprNode, deprecationInfo.ui5TypeInfo); } this.#reporter.addMessage(MESSAGE.DEPRECATED_FUNCTION_CALL, { functionName: propName, @@ -1795,4 +1796,8 @@ export default class SourceFileLinter { getCoreFixHints(node: ts.CallExpression | ts.AccessExpression, ui5TypeInfo?: Ui5TypeInfo) { return this.#fixHintsGenerator?.getCoreFixHints(node, ui5TypeInfo); } + + getConfigFixHints(node: ts.CallExpression | ts.AccessExpression, ui5TypeInfo?: Ui5TypeInfo) { + return this.#fixHintsGenerator?.getConfigFixHints(node, ui5TypeInfo); + } } diff --git a/src/linter/ui5Types/fixHints/ConfigurationFixHintsGenerator.ts b/src/linter/ui5Types/fixHints/ConfigurationFixHintsGenerator.ts new file mode 100644 index 000000000..4ed13fb52 --- /dev/null +++ b/src/linter/ui5Types/fixHints/ConfigurationFixHintsGenerator.ts @@ -0,0 +1,158 @@ +import ts from "typescript"; +import type {ExportCodeToBeUsed, FixHints} from "./FixHints.js"; +import {isExpectedValueExpression, Ui5TypeInfoKind} from "../utils/utils.js"; +import type {Ui5TypeInfo} from "../utils/utils.js"; + +const configurationModulesReplacements = new Map([ + // https://github.com/SAP/ui5-linter/issues/620 + ["getAccessibility", { + moduleName: "sap/ui/core/ControlBehavior", exportNameToBeUsed: "isAccessibilityEnabled", + }], + ["getActiveTerminologies", { + moduleName: "sap/base/i18n/Localization", exportNameToBeUsed: "getActiveTerminologies", + }], + ["getAllowlistService", { + moduleName: "sap/ui/security/Security", exportNameToBeUsed: "getAllowlistService", + }], + ["getAnimationMode", { + moduleName: "sap/ui/core/ControlBehavior", exportNameToBeUsed: "getAnimationMode", + }], + ["getCalendarType", { + moduleName: "sap/base/i18n/Formatting", exportNameToBeUsed: "getCalendarType", + }], + ["getCalendarWeekNumbering", { + moduleName: "sap/base/i18n/Formatting", exportNameToBeUsed: "getCalendarWeekNumbering", + }], + ["getFrameOptions", { + moduleName: "sap/ui/security/Security", exportNameToBeUsed: "getFrameOptions", + }], + ["getLanguage", { + moduleName: "sap/base/i18n/Localization", exportNameToBeUsed: "getLanguage", + }], + ["getRTL", { + moduleName: "sap/base/i18n/Localization", exportNameToBeUsed: "getRTL", + }], + ["getSAPLogonLanguage", { + moduleName: "sap/base/i18n/Localization", exportNameToBeUsed: "getSAPLogonLanguage", + }], + ["getSecurityTokenHandlers", { + moduleName: "sap/ui/security/Security", exportNameToBeUsed: "getSecurityTokenHandlers", + }], + ["getTheme", { + moduleName: "sap/ui/core/Theming", exportNameToBeUsed: "getTheme", + }], + ["getTimezone", { + moduleName: "sap/base/i18n/Localization", exportNameToBeUsed: "getTimezone", + }], + ["getUIDPrefix", { + moduleName: "sap/ui/base/ManagedObjectMetadata", exportNameToBeUsed: "getUIDPrefix", + }], + ["getWhitelistService", { + moduleName: "sap/ui/security/Security", exportNameToBeUsed: "getAllowlistService", + }], + ["setAnimationMode", { + moduleName: "sap/ui/core/ControlBehavior", exportNameToBeUsed: "setAnimationMode", + }], + ["setSecurityTokenHandlers", { + moduleName: "sap/ui/security/Security", exportNameToBeUsed: "setSecurityTokenHandlers", + }], + + // Note: Not 1:1 compatible. Does not return "this" + ["setCalendarType", { + moduleName: "sap/base/i18n/Formatting", exportCodeToBeUsed: "$moduleIdentifier.setCalendarType($1)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setCalendarWeekNumbering", { + moduleName: "sap/base/i18n/Formatting", exportCodeToBeUsed: "$moduleIdentifier.setCalendarWeekNumbering($1)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setFormatLocale", { + moduleName: "sap/base/i18n/Formatting", exportCodeToBeUsed: "$moduleIdentifier.setFormatLocale($1)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setLanguage", { + moduleName: "sap/base/i18n/Localization", exportCodeToBeUsed: "$moduleIdentifier.setLanguage($1, $2)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setRTL", { + moduleName: "sap/base/i18n/Localization", exportCodeToBeUsed: "$moduleIdentifier.setRTL($1)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setTheme", { + moduleName: "sap/ui/core/Theming", exportCodeToBeUsed: "$moduleIdentifier.setTheme($1)", + }], + // Note: Not 1:1 compatible. Does not return "this" + ["setTimezone", { + moduleName: "sap/base/i18n/Localization", exportCodeToBeUsed: "$moduleIdentifier.setTimezone($1)", + }], + + ["getLanguageTag", { + moduleName: "sap/base/i18n/Localization", exportCodeToBeUsed: "$moduleIdentifier.getLanguageTag().toString()", + }], + + // TODO: Complex replacement: Discuss: Old API returns boolean, new API returns AnimationMode. How to migrate? + // (-> 2 new module imports) How to setup this map entry? + // getAnimation() + + ["getFormatLocale", { + moduleName: "sap/base/i18n/Formatting", exportCodeToBeUsed: "$moduleIdentifier.getFormatLocale().toString()", + }], + + // TODO: Complex replacement: + // "Configuration.getLocale()" needs to be replaced with "new Locale(Localization.getLanguageTag())". + // (-> 2 new module imports) How to setup this map entry? + // getLocale() + + // Migration not possible + // Old API is sync and new API is async + // getVersion() +]); + +export default class ConfigurationFixHintsGenerator { + getFixHints(node: ts.CallExpression | ts.AccessExpression, ui5TypeInfo?: Ui5TypeInfo): FixHints | undefined { + if (!ts.isPropertyAccessExpression(node)) { + return undefined; + } + + if (!ui5TypeInfo || + ui5TypeInfo.kind !== Ui5TypeInfoKind.Module || + ui5TypeInfo.module !== "sap/ui/core/Configuration") { + return undefined; + } + + const methodName = "export" in ui5TypeInfo ? ui5TypeInfo.export ?? "" : ""; + const moduleReplacement = configurationModulesReplacements.get(methodName); + if (!moduleReplacement) { + return undefined; + } + + let exportCodeToBeUsed; + if (moduleReplacement.exportCodeToBeUsed) { + exportCodeToBeUsed = { + name: moduleReplacement.exportCodeToBeUsed, + // Check whether the return value of the call expression is assigned to a variable, + // passed to another function or used elsewhere. + isExpectedValue: isExpectedValueExpression(node), + } as ExportCodeToBeUsed; + + let callExpression; + if (ts.isCallExpression(node.parent) && + // if a prop is wrapped in a function, then current.parent is the call expression + // which is wrong. That's why check if parent expression is actually the current node + // which would ensure that the prop is actually a call expression. + node.parent.expression === node) { + callExpression = node.parent; + } + + // Extract arguments from the call expression + if (callExpression) { + exportCodeToBeUsed.args = callExpression.arguments.map((arg) => ({ + value: arg.getText(), + kind: arg?.kind, + })); + } + } + + return {...moduleReplacement, exportCodeToBeUsed}; + } +} diff --git a/src/linter/ui5Types/fixHints/FixHintsGenerator.ts b/src/linter/ui5Types/fixHints/FixHintsGenerator.ts index c97b4994f..ef2983d21 100644 --- a/src/linter/ui5Types/fixHints/FixHintsGenerator.ts +++ b/src/linter/ui5Types/fixHints/FixHintsGenerator.ts @@ -5,11 +5,13 @@ import JquerySapFixHintsGenerator from "./JquerySapFixHintsGenerator.js"; import CoreFixHintsGenerator from "./CoreFixHintsGenerator.js"; import {FixHints} from "./FixHints.js"; import type {Ui5TypeInfo} from "../utils/utils.js"; +import ConfigurationFixHintsGenerator from "./ConfigurationFixHintsGenerator.js"; export default class FixHintsGenerator { private globalsGenerator: GlobalsFixHintsGenerator; private jquerySapGenerator: JquerySapFixHintsGenerator; private coreGenerator: CoreFixHintsGenerator; + private configGenerator: ConfigurationFixHintsGenerator; constructor( resourcePath: string, @@ -18,6 +20,7 @@ export default class FixHintsGenerator { this.globalsGenerator = new GlobalsFixHintsGenerator(resourcePath, ambientModuleCache); this.jquerySapGenerator = new JquerySapFixHintsGenerator(); this.coreGenerator = new CoreFixHintsGenerator(ambientModuleCache); + this.configGenerator = new ConfigurationFixHintsGenerator(); } public getGlobalsFixHints(node: ts.CallExpression | ts.AccessExpression): FixHints | undefined { @@ -34,4 +37,9 @@ export default class FixHintsGenerator { ui5TypeInfo?: Ui5TypeInfo): FixHints | undefined { return this.coreGenerator.getFixHints(node, ui5TypeInfo); } + + public getConfigFixHints(node: ts.CallExpression | ts.AccessExpression, + ui5TypeInfo?: Ui5TypeInfo): FixHints | undefined { + return this.configGenerator.getFixHints(node, ui5TypeInfo); + } } diff --git a/src/linter/ui5Types/utils/utils.ts b/src/linter/ui5Types/utils/utils.ts index 273950a5a..ae26fbf21 100644 --- a/src/linter/ui5Types/utils/utils.ts +++ b/src/linter/ui5Types/utils/utils.ts @@ -249,9 +249,11 @@ export function isExpectedValueExpression(node: ts.Node): boolean { node.parent.arguments.some((arg) => arg === node)) || // Chaining (ts.isPropertyAccessExpression(node) && - ts.isCallExpression(node.expression) && - ts.isPropertyAccessExpression(node.expression.parent) && - ts.isCallExpression(node.expression.parent.expression)) + ts.isCallExpression(node.parent) && node.parent.expression === node && + ts.isPropertyAccessExpression(node.parent.parent) && + node.parent.parent.expression === node.parent && + ts.isCallExpression(node.parent.parent.parent) && + node.parent.parent.parent.expression === node.parent.parent) ) { isExpectedValue = true; } diff --git a/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApi.js b/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApi.js new file mode 100644 index 000000000..119d46a30 --- /dev/null +++ b/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApi.js @@ -0,0 +1,51 @@ +// This test artifact contains all deprecated configuration API methods which are EASILY migratable +sap.ui.define([ + "sap/ui/core/Configuration", +], (ConfigurationRenamed) => { + ConfigurationRenamed.getAccessibility(); + ConfigurationRenamed.getActiveTerminologies(); + ConfigurationRenamed.getAllowlistService(); + ConfigurationRenamed.getAnimationMode(); + ConfigurationRenamed.getCalendarType(); + ConfigurationRenamed.getCalendarWeekNumbering(); + ConfigurationRenamed.getFrameOptions(); + ConfigurationRenamed.getLanguage(); + ConfigurationRenamed.getRTL(); + ConfigurationRenamed.getSAPLogonLanguage(); + ConfigurationRenamed.getSecurityTokenHandlers(); + ConfigurationRenamed.getTheme(); + ConfigurationRenamed.getTimezone(); + ConfigurationRenamed.getUIDPrefix(); + ConfigurationRenamed.getWhitelistService(); + ConfigurationRenamed.setAnimationMode(ConfigurationRenamed.AnimationMode.minimal); + ConfigurationRenamed.setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]); + ConfigurationRenamed.getLanguageTag(); + ConfigurationRenamed.getFormatLocale(); + + + ConfigurationRenamed.setCalendarType(sCalendarType); + ConfigurationRenamed.setCalendarWeekNumbering(sCalendarWeekNumbering); + ConfigurationRenamed.setFormatLocale(sFormatLocale); + ConfigurationRenamed.setLanguage(sLanguage, sSAPLogonLanguage); + ConfigurationRenamed.setLanguage(sLanguage); + ConfigurationRenamed.setRTL(bRTL); + ConfigurationRenamed.setTheme(sTheme); + ConfigurationRenamed.setTimezone(sTimezone); + + // Do not migrate these methods, as they used to return "this" and now return "undefined". + // Further more, now the functionality is moved into multiple modules. + ConfigurationRenamed.setRTL(false).setLanguage("en"); + const setCalendar = (type) => ConfigurationRenamed.setCalendarType(type); + const typedCalendar = sType ? ConfigurationRenamed.setCalendarType(sType) : null; + debug("msg 2", ConfigurationRenamed.setFormatLocale(sFormatLocale)); + debug("msg 2", (ConfigurationRenamed.setFormatLocale(sFormatLocale))); + debug("msg 2", ((((ConfigurationRenamed.setFormatLocale(sFormatLocale)))))); + var time = ConfigurationRenamed.setTimezone(sTimezone); + var info = { + theme: ConfigurationRenamed.setTheme(sTheme) + }; + ConfigurationRenamed.setTheme(sTheme) ?? ConfigurationRenamed.setTimezone(sTimezone); + ConfigurationRenamed.setCalendarWeekNumbering(sCalendarWeekNumbering) ? "a" : "b"; + ConfigurationRenamed.setCalendarType(sCalendarType), ConfigurationRenamed.setCalendarWeekNumbering(sCalendarWeekNumbering); + fnCall(ConfigurationRenamed.setLanguage(sLanguage)); +}); diff --git a/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApiWithoutImport.js b/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApiWithoutImport.js new file mode 100644 index 000000000..cd5c58e72 --- /dev/null +++ b/test/fixtures/autofix/configurationApi/DeprecatedConfigurationApiWithoutImport.js @@ -0,0 +1,89 @@ +// This test artifact contains all deprecated configuration API methods which are EASILY migratable +// without import (only use of globals) +sap.ui.define([], () => { + const globalConfiguration = sap.ui.getCore().getConfiguration(); + + globalConfiguration.getAccessibility(); + sap.ui.getCore().getConfiguration().getAccessibility(); + + globalConfiguration.getActiveTerminologies(); + sap.ui.getCore().getConfiguration().getActiveTerminologies(); + + globalConfiguration.getAllowlistService(); + sap.ui.getCore().getConfiguration().getAllowlistService(); + + globalConfiguration.getAnimationMode(); + sap.ui.getCore().getConfiguration().getAnimationMode(); + + globalConfiguration.getCalendarType(); + sap.ui.getCore().getConfiguration().getCalendarType(); + + globalConfiguration.getCalendarWeekNumbering(); + sap.ui.getCore().getConfiguration().getCalendarWeekNumbering(); + + globalConfiguration.getFrameOptions(); + sap.ui.getCore().getConfiguration().getFrameOptions(); + + globalConfiguration.getLanguage(); + sap.ui.getCore().getConfiguration().getLanguage(); + + globalConfiguration.getRTL(); + sap.ui.getCore().getConfiguration().getRTL(); + + globalConfiguration.getSAPLogonLanguage(); + sap.ui.getCore().getConfiguration().getSAPLogonLanguage(); + + globalConfiguration.getSecurityTokenHandlers(); + sap.ui.getCore().getConfiguration().getSecurityTokenHandlers(); + + globalConfiguration.getTheme(); + sap.ui.getCore().getConfiguration().getTheme(); + + globalConfiguration.getTimezone(); + sap.ui.getCore().getConfiguration().getTimezone(); + + globalConfiguration.getUIDPrefix(); + sap.ui.getCore().getConfiguration().getUIDPrefix(); + + globalConfiguration.getWhitelistService(); + sap.ui.getCore().getConfiguration().getWhitelistService(); + + globalConfiguration.setAnimationMode(globalConfiguration.AnimationMode.minimal); + sap.ui.getCore().getConfiguration().setAnimationMode(sap.ui.getCore().getConfiguration().AnimationMode.minimal); + + globalConfiguration.setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]); + sap.ui.getCore().getConfiguration().setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]); + + globalConfiguration.getLanguageTag(); + sap.ui.getCore().getConfiguration().getLanguageTag(); + + globalConfiguration.getFormatLocale(); + sap.ui.getCore().getConfiguration().getFormatLocale(); + + + sap.ui.getCore().getConfiguration().setCalendarType(sCalendarType); + sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering); + sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale); + globalConfiguration.setLanguage(sLanguage, sSAPLogonLanguage); + sap.ui.getCore().getConfiguration().setLanguage(sLanguage); + sap.ui.getCore().getConfiguration().setRTL(bRTL); + globalConfiguration.setTheme(sTheme); + sap.ui.getCore().getConfiguration().setTimezone(sTimezone); + + // Do not migrate these methods, as they used to return "this" and now return "undefined". + // Further more, now the functionality is moved into multiple modules. + sap.ui.getCore().getConfiguration().setRTL(false).setLanguage("en"); + const setCalendar = (type) => sap.ui.getCore().getConfiguration().setCalendarType(type); + const typedCalendar = sType ? sap.ui.getCore().getConfiguration().setCalendarType(sType) : null; + debug("msg 2", sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale)); + debug("msg 2", (globalConfiguration.setFormatLocale(sFormatLocale))); + debug("msg 2", ((((sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale)))))); + var time = sap.ui.getCore().getConfiguration().setTimezone(sTimezone); + var info = { + theme: globalConfiguration.setTheme(sTheme) + }; + globalConfiguration.setTheme(sTheme) ?? sap.ui.getCore().getConfiguration().setTimezone(sTimezone); + sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering) ? "a" : "b"; + globalConfiguration.setCalendarType(sCalendarType), sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering); + fnCall(sap.ui.getCore().getConfiguration().setLanguage(sLanguage)); +}); diff --git a/test/lib/autofix/snapshots/autofix.fixtures.ts.md b/test/lib/autofix/snapshots/autofix.fixtures.ts.md index 3f2b0cac0..e5f670b22 100644 --- a/test/lib/autofix/snapshots/autofix.fixtures.ts.md +++ b/test/lib/autofix/snapshots/autofix.fixtures.ts.md @@ -5209,6 +5209,1028 @@ Generated by [AVA](https://avajs.dev). }, ] +## General: configurationApi/DeprecatedConfigurationApi.js + +> AutofixResult: /configurationApi/DeprecatedConfigurationApi.js + + `// This test artifact contains all deprecated configuration API methods which are EASILY migratable␊ + sap.ui.define([␊ + "sap/ui/core/Configuration",␊ + "sap/base/i18n/Formatting",␊ + "sap/base/i18n/Localization",␊ + "sap/ui/base/ManagedObjectMetadata",␊ + "sap/ui/core/ControlBehavior",␊ + "sap/ui/core/Theming",␊ + "sap/ui/security/Security",␊ + ], (ConfigurationRenamed, Formatting, Localization, ManagedObjectMetadata, ControlBehavior, Theming, Security) => {␊ + ControlBehavior.isAccessibilityEnabled();␊ + Localization.getActiveTerminologies();␊ + Security.getAllowlistService();␊ + ControlBehavior.getAnimationMode();␊ + Formatting.getCalendarType();␊ + Formatting.getCalendarWeekNumbering();␊ + Security.getFrameOptions();␊ + Localization.getLanguage();␊ + Localization.getRTL();␊ + Localization.getSAPLogonLanguage();␊ + Security.getSecurityTokenHandlers();␊ + Theming.getTheme();␊ + Localization.getTimezone();␊ + ManagedObjectMetadata.getUIDPrefix();␊ + Security.getAllowlistService();␊ + ControlBehavior.setAnimationMode(ConfigurationRenamed.AnimationMode.minimal);␊ + Security.setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]);␊ + Localization.getLanguageTag().toString();␊ + Formatting.getFormatLocale().toString();␊ + ␊ + ␊ + Formatting.setCalendarType(sCalendarType);␊ + Formatting.setCalendarWeekNumbering(sCalendarWeekNumbering);␊ + Formatting.setFormatLocale(sFormatLocale);␊ + Localization.setLanguage(sLanguage, sSAPLogonLanguage);␊ + Localization.setLanguage(sLanguage);␊ + Localization.setRTL(bRTL);␊ + Theming.setTheme(sTheme);␊ + Localization.setTimezone(sTimezone);␊ + ␊ + // Do not migrate these methods, as they used to return "this" and now return "undefined".␊ + // Further more, now the functionality is moved into multiple modules.␊ + ConfigurationRenamed.setRTL(false).setLanguage("en");␊ + const setCalendar = (type) => ConfigurationRenamed.setCalendarType(type);␊ + const typedCalendar = sType ? ConfigurationRenamed.setCalendarType(sType) : null;␊ + debug("msg 2", ConfigurationRenamed.setFormatLocale(sFormatLocale));␊ + debug("msg 2", (ConfigurationRenamed.setFormatLocale(sFormatLocale)));␊ + debug("msg 2", ((((ConfigurationRenamed.setFormatLocale(sFormatLocale))))));␊ + var time = ConfigurationRenamed.setTimezone(sTimezone);␊ + var info = {␊ + theme: ConfigurationRenamed.setTheme(sTheme)␊ + };␊ + ConfigurationRenamed.setTheme(sTheme) ?? ConfigurationRenamed.setTimezone(sTimezone);␊ + ConfigurationRenamed.setCalendarWeekNumbering(sCalendarWeekNumbering) ? "a" : "b";␊ + ConfigurationRenamed.setCalendarType(sCalendarType), ConfigurationRenamed.setCalendarWeekNumbering(sCalendarWeekNumbering);␊ + fnCall(ConfigurationRenamed.setLanguage(sLanguage));␊ + });␊ + ` + +> LintResult: configurationApi/DeprecatedConfigurationApi.js + + [ + { + coverageInfo: [ + { + category: 1, + column: 2, + line: 29, + message: 'Unable to analyze this method call because the type of identifier "toString" in "Formatting.getFormatLocale().toString()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 29, + message: 'Unable to analyze this method call because the type of identifier "getFormatLocale" in "Formatting.getFormatLocale()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 34, + message: 'Unable to analyze this method call because the type of identifier "setFormatLocale" in "Formatting.setFormatLocale(sFormatLocale)"" could not be determined', + }, + { + category: 1, + column: 2, + line: 46, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", ConfigurationRenamed.setFormatLocale(sFormatLocale))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 47, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", (ConfigurationRenamed.setFormatLocale(sFormatLocale)))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 48, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", ((((ConfigurationRenamed.setFormatLocale(sFormatLocale))))))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 56, + message: 'Unable to analyze this method call because the type of identifier in "fnCall(ConfigurationRenamed.setLanguage(sLanguage))"" could not be determined', + }, + ], + errorCount: 17, + fatalErrorCount: 0, + filePath: 'DeprecatedConfigurationApi.js', + messages: [ + { + column: 2, + line: 3, + message: 'Import of deprecated module \'sap/ui/core/Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 35, + line: 26, + message: 'Use of deprecated property \'AnimationMode\' (ConfigurationRenamed.AnimationMode.minimal)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 23, + line: 43, + message: 'Call to deprecated function \'setRTL\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 37, + line: 43, + message: 'Call to deprecated function \'setLanguage\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 53, + line: 44, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 53, + line: 45, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 46, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 39, + line: 47, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 42, + line: 48, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 34, + line: 49, + message: 'Call to deprecated function \'setTimezone\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 31, + line: 51, + message: 'Call to deprecated function \'setTheme\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 23, + line: 53, + message: 'Call to deprecated function \'setTheme\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 64, + line: 53, + message: 'Call to deprecated function \'setTimezone\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 23, + line: 54, + message: 'Call to deprecated function \'setCalendarWeekNumbering\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 23, + line: 55, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 76, + line: 55, + message: 'Call to deprecated function \'setCalendarWeekNumbering\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 30, + line: 56, + message: 'Call to deprecated function \'setLanguage\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + ], + warningCount: 0, + }, + ] + +## General: configurationApi/DeprecatedConfigurationApiWithoutImport.js + +> AutofixResult: /configurationApi/DeprecatedConfigurationApiWithoutImport.js + + `// This test artifact contains all deprecated configuration API methods which are EASILY migratable␊ + // without import (only use of globals)␊ + sap.ui.define(["sap/base/i18n/Formatting", "sap/base/i18n/Localization", "sap/ui/base/ManagedObjectMetadata", "sap/ui/core/ControlBehavior", "sap/ui/core/Theming", "sap/ui/security/Security"], (Formatting, Localization, ManagedObjectMetadata, ControlBehavior, Theming, Security) => {␊ + const globalConfiguration = sap.ui.getCore().getConfiguration();␊ + ␊ + ControlBehavior.isAccessibilityEnabled();␊ + ControlBehavior.isAccessibilityEnabled();␊ + ␊ + Localization.getActiveTerminologies();␊ + Localization.getActiveTerminologies();␊ + ␊ + Security.getAllowlistService();␊ + Security.getAllowlistService();␊ + ␊ + ControlBehavior.getAnimationMode();␊ + ControlBehavior.getAnimationMode();␊ + ␊ + Formatting.getCalendarType();␊ + Formatting.getCalendarType();␊ + ␊ + Formatting.getCalendarWeekNumbering();␊ + Formatting.getCalendarWeekNumbering();␊ + ␊ + Security.getFrameOptions();␊ + Security.getFrameOptions();␊ + ␊ + Localization.getLanguage();␊ + Localization.getLanguage();␊ + ␊ + Localization.getRTL();␊ + Localization.getRTL();␊ + ␊ + Localization.getSAPLogonLanguage();␊ + Localization.getSAPLogonLanguage();␊ + ␊ + Security.getSecurityTokenHandlers();␊ + Security.getSecurityTokenHandlers();␊ + ␊ + Theming.getTheme();␊ + Theming.getTheme();␊ + ␊ + Localization.getTimezone();␊ + Localization.getTimezone();␊ + ␊ + ManagedObjectMetadata.getUIDPrefix();␊ + ManagedObjectMetadata.getUIDPrefix();␊ + ␊ + Security.getAllowlistService();␊ + Security.getAllowlistService();␊ + ␊ + ControlBehavior.setAnimationMode(globalConfiguration.AnimationMode.minimal);␊ + ControlBehavior.setAnimationMode(sap.ui.getCore().getConfiguration().AnimationMode.minimal);␊ + ␊ + Security.setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]);␊ + Security.setSecurityTokenHandlers([() => {console.log("*Security token handler*");}]);␊ + ␊ + Localization.getLanguageTag().toString();␊ + Localization.getLanguageTag().toString();␊ + ␊ + Formatting.getFormatLocale().toString();␊ + Formatting.getFormatLocale().toString();␊ + ␊ + ␊ + sap.ui.getCore().getConfiguration().setCalendarType(sCalendarType);␊ + sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering);␊ + sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale);␊ + Localization.setLanguage(sLanguage, sSAPLogonLanguage);␊ + sap.ui.getCore().getConfiguration().setLanguage(sLanguage);␊ + sap.ui.getCore().getConfiguration().setRTL(bRTL);␊ + Theming.setTheme(sTheme);␊ + sap.ui.getCore().getConfiguration().setTimezone(sTimezone);␊ + ␊ + // Do not migrate these methods, as they used to return "this" and now return "undefined".␊ + // Further more, now the functionality is moved into multiple modules.␊ + sap.ui.getCore().getConfiguration().setRTL(false).setLanguage("en");␊ + const setCalendar = (type) => sap.ui.getCore().getConfiguration().setCalendarType(type);␊ + const typedCalendar = sType ? sap.ui.getCore().getConfiguration().setCalendarType(sType) : null;␊ + debug("msg 2", sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale));␊ + debug("msg 2", (globalConfiguration.setFormatLocale(sFormatLocale)));␊ + debug("msg 2", ((((sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale))))));␊ + var time = sap.ui.getCore().getConfiguration().setTimezone(sTimezone);␊ + var info = {␊ + theme: globalConfiguration.setTheme(sTheme)␊ + };␊ + globalConfiguration.setTheme(sTheme) ?? sap.ui.getCore().getConfiguration().setTimezone(sTimezone);␊ + sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering) ? "a" : "b";␊ + globalConfiguration.setCalendarType(sCalendarType), sap.ui.getCore().getConfiguration().setCalendarWeekNumbering(sCalendarWeekNumbering);␊ + fnCall(sap.ui.getCore().getConfiguration().setLanguage(sLanguage));␊ + });␊ + ` + +> LintResult: configurationApi/DeprecatedConfigurationApiWithoutImport.js + + [ + { + coverageInfo: [ + { + category: 1, + column: 2, + line: 60, + message: 'Unable to analyze this method call because the type of identifier "toString" in "Formatting.getFormatLocale().toString()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 60, + message: 'Unable to analyze this method call because the type of identifier "getFormatLocale" in "Formatting.getFormatLocale()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 61, + message: 'Unable to analyze this method call because the type of identifier "toString" in "Formatting.getFormatLocale().toString()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 61, + message: 'Unable to analyze this method call because the type of identifier "getFormatLocale" in "Formatting.getFormatLocale()"" could not be determined', + }, + { + category: 1, + column: 2, + line: 78, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 79, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", (globalConfiguration.setFormatLocale(sFormatLocale)))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 80, + message: 'Unable to analyze this method call because the type of identifier in "debug("msg 2", ((((sap.ui.getCore().getConfiguration().setFormatLocale(sFormatLocale))))))"" could not be determined', + }, + { + category: 1, + column: 2, + line: 88, + message: 'Unable to analyze this method call because the type of identifier in "fnCall(sap.ui.getCore().getConfiguration().setLanguage(sLanguage))"" could not be determined', + }, + ], + errorCount: 76, + fatalErrorCount: 0, + filePath: 'DeprecatedConfigurationApiWithoutImport.js', + messages: [ + { + column: 30, + line: 4, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 37, + line: 4, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 47, + line: 4, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 35, + line: 51, + message: 'Use of deprecated property \'AnimationMode\' (globalConfiguration.AnimationMode.minimal)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 35, + line: 52, + message: 'Use of deprecated property \'AnimationMode\' (sap.ui.getCore().getConfiguration().AnimationMode.minimal)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 42, + line: 52, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 52, + line: 52, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 64, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 64, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 64, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 64, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 65, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 65, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 65, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 65, + message: 'Call to deprecated function \'setCalendarWeekNumbering\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 66, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 66, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 66, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 66, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 68, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 68, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 68, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 68, + message: 'Call to deprecated function \'setLanguage\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 69, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 69, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 69, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 69, + message: 'Call to deprecated function \'setRTL\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 71, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 71, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 71, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 71, + message: 'Call to deprecated function \'setTimezone\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 75, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 75, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 75, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 75, + message: 'Call to deprecated function \'setRTL\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 52, + line: 75, + message: 'Call to deprecated function \'setLanguage\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 32, + line: 76, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 39, + line: 76, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 49, + line: 76, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 68, + line: 76, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 32, + line: 77, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 39, + line: 77, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 49, + line: 77, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 68, + line: 77, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 17, + line: 78, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 24, + line: 78, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 34, + line: 78, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 53, + line: 78, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 79, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 21, + line: 80, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 28, + line: 80, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 80, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 57, + line: 80, + message: 'Call to deprecated function \'setFormatLocale\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 13, + line: 81, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 20, + line: 81, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 30, + line: 81, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 49, + line: 81, + message: 'Call to deprecated function \'setTimezone\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 30, + line: 83, + message: 'Call to deprecated function \'setTheme\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 22, + line: 85, + message: 'Call to deprecated function \'setTheme\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 42, + line: 85, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 49, + line: 85, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 59, + line: 85, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 78, + line: 85, + message: 'Call to deprecated function \'setTimezone\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 2, + line: 86, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 9, + line: 86, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 19, + line: 86, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 38, + line: 86, + message: 'Call to deprecated function \'setCalendarWeekNumbering\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 22, + line: 87, + message: 'Call to deprecated function \'setCalendarType\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 54, + line: 87, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 61, + line: 87, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 71, + line: 87, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 90, + line: 87, + message: 'Call to deprecated function \'setCalendarWeekNumbering\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 9, + line: 88, + message: 'Access of global variable \'sap\' (sap.ui.getCore)', + messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)', + ruleId: 'no-globals', + severity: 2, + }, + { + column: 16, + line: 88, + message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 26, + line: 88, + message: 'Call to deprecated function \'getConfiguration\' of class \'Core\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + { + column: 45, + line: 88, + message: 'Call to deprecated function \'setLanguage\' of class \'Configuration\'', + messageDetails: 'Deprecated test message', + ruleId: 'no-deprecated-api', + severity: 2, + }, + ], + warningCount: 0, + }, + ] + ## General: coreApi/DeprecatedCoreApi.js > AutofixResult: /coreApi/DeprecatedCoreApi.js diff --git a/test/lib/autofix/snapshots/autofix.fixtures.ts.snap b/test/lib/autofix/snapshots/autofix.fixtures.ts.snap index e1534e872..efa97ca99 100644 Binary files a/test/lib/autofix/snapshots/autofix.fixtures.ts.snap and b/test/lib/autofix/snapshots/autofix.fixtures.ts.snap differ