From e8e2314032ecae84e427b4c5e680805d124a7ac6 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Mon, 4 Mar 2024 09:35:57 +0100 Subject: [PATCH] feat: Detect usage of deprecated jQuery.sap API So far, only the usage of global API such as `jQuery.sap` was detected. However, when using `jQuery` as local variable via a dependency, the usage of `jQuery.sap` was not detected, although all APIs within that namespace are deprecated. --- resources/overrides/index.d.ts | 1 + resources/overrides/jquery.sap.d.ts | 65 +++++++ resources/overrides/jquery.sap.mobile.d.ts | 4 - src/detectors/typeChecker/FileLinter.ts | 39 +++- .../NoDeprecatedApi/jQuery.sap-global.js | 3 - .../NoDeprecatedApi/jQuery.sap-jquery.js | 3 - .../NoDeprecatedApi/jQuery.sap-module.js | 3 - .../rules/NoDeprecatedApi/jQuery.sap.js | 17 ++ .../linter/rules/NoGlobals/NoGlobals.js | 2 +- .../rules/snapshots/NoDeprecatedApi.ts.md | 175 +++++++++++++----- .../rules/snapshots/NoDeprecatedApi.ts.snap | Bin 4393 -> 4952 bytes .../linter/rules/snapshots/NoGlobals.ts.md | 5 +- .../linter/rules/snapshots/NoGlobals.ts.snap | Bin 1532 -> 1596 bytes 13 files changed, 243 insertions(+), 74 deletions(-) create mode 100644 resources/overrides/jquery.sap.d.ts delete mode 100644 test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-global.js delete mode 100644 test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-jquery.js delete mode 100644 test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-module.js create mode 100644 test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap.js diff --git a/resources/overrides/index.d.ts b/resources/overrides/index.d.ts index 9bf823e08..d0085e99e 100644 --- a/resources/overrides/index.d.ts +++ b/resources/overrides/index.d.ts @@ -1 +1,2 @@ import "./jquery.sap.mobile"; +import "./jquery.sap"; diff --git a/resources/overrides/jquery.sap.d.ts b/resources/overrides/jquery.sap.d.ts new file mode 100644 index 000000000..3818f9c0b --- /dev/null +++ b/resources/overrides/jquery.sap.d.ts @@ -0,0 +1,65 @@ +// General deprecation of jQuery.sap namespace +interface JQueryStatic { + /** + * @deprecated since 1.58. To avoid usage of global variables in general, please + * do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities + * are replaced by alternative modules which can be found in the API doc. + */ + sap: object; +} + +// Add exports of all jquery.sap.* modules (except for "jquery.sap.promise" which does not export jQuery) +declare module "jquery.sap.act" { + export default jQuery; +} +declare module "jquery.sap.dom" { + export default jQuery; +} +declare module "jquery.sap.encoder" { + export default jQuery; +} +declare module "jquery.sap.events" { + export default jQuery; +} +declare module "jquery.sap.global" { + export default jQuery; +} +declare module "jquery.sap.history" { + export default jQuery; +} +declare module "jquery.sap.keycodes" { + export default jQuery; +} +declare module "jquery.sap.mobile" { + export default jQuery; +} +declare module "jquery.sap.properties" { + export default jQuery; +} +declare module "jquery.sap.resources" { + export default jQuery; +} +declare module "jquery.sap.script" { + export default jQuery; +} +declare module "jquery.sap.sjax" { + export default jQuery; +} +declare module "jquery.sap.storage" { + export default jQuery; +} +declare module "jquery.sap.strings" { + export default jQuery; +} +declare module "jquery.sap.stubs" { + export default jQuery; +} +declare module "jquery.sap.trace" { + export default jQuery; +} +declare module "jquery.sap.ui" { + export default jQuery; +} +declare module "jquery.sap.xml" { + export default jQuery; +} diff --git a/resources/overrides/jquery.sap.mobile.d.ts b/resources/overrides/jquery.sap.mobile.d.ts index 87ffad010..a2d446c65 100644 --- a/resources/overrides/jquery.sap.mobile.d.ts +++ b/resources/overrides/jquery.sap.mobile.d.ts @@ -11,7 +11,3 @@ interface JQueryStatic { */ device: object; } - -declare module "jquery.sap.mobile" { - export default jQuery; -} diff --git a/src/detectors/typeChecker/FileLinter.ts b/src/detectors/typeChecker/FileLinter.ts index bd01018f6..e797296dd 100644 --- a/src/detectors/typeChecker/FileLinter.ts +++ b/src/detectors/typeChecker/FileLinter.ts @@ -229,15 +229,32 @@ export default class FileLinter { const symbol = this.isDeprecatedAccess(node); if (symbol) { - this.#reporter.addMessage({ - node, - severity: LintMessageSeverity.Error, - ruleId: "ui5-linter-no-deprecated-property", - message: - `Access of deprecated property ` + - `'${symbol.escapedName as string}'`, - messageDetails: this.extractDeprecatedMessage(symbol), - }); + const messageDetails = this.extractDeprecatedMessage(symbol); + if (this.isSymbolOfJquerySapType(symbol)) { + let namespace; + if (ts.isPropertyAccessExpression(node)) { + namespace = this.extractNamespace(node); + } + this.#reporter.addMessage({ + node, + severity: LintMessageSeverity.Error, + ruleId: "ui5-linter-no-deprecated-api", + message: + `Use of deprecated API ` + + `'${namespace ?? "jQuery.sap"}'`, + messageDetails, + }); + } else { + this.#reporter.addMessage({ + node, + severity: LintMessageSeverity.Error, + ruleId: "ui5-linter-no-deprecated-property", + message: + `Access of deprecated property ` + + `'${symbol.escapedName as string}'`, + messageDetails, + }); + } } } @@ -372,6 +389,10 @@ export default class FileLinter { return false; } + isSymbolOfJquerySapType(symbol: ts.Symbol) { + return symbol.valueDeclaration?.getSourceFile().fileName === "/types/@ui5/linter/overrides/jquery.sap.d.ts"; + } + findClassOrInterface(node: ts.Node): ts.Type | undefined { let nodeType: ts.Type | undefined = this.#checker.getTypeAtLocation(node); if (nodeType.isClassOrInterface()) { diff --git a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-global.js b/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-global.js deleted file mode 100644 index 7e7e4af1a..000000000 --- a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-global.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define([], function() { - var oProperties = jQuery.sap.properties(); // jQuery.sap.properties is deprecated -}); diff --git a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-jquery.js b/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-jquery.js deleted file mode 100644 index e50bdde83..000000000 --- a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-jquery.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["sap/ui/thirdparty/jquery"], function(jQuery) { - var oProperties = jQuery.sap.properties(); // TODO detect: jQuery.sap.properties is deprecated -}); diff --git a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-module.js b/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-module.js deleted file mode 100644 index fffe37b42..000000000 --- a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap-module.js +++ /dev/null @@ -1,3 +0,0 @@ -sap.ui.define(["jquery.sap.properties"], function(jQuery) { - var oProperties = jQuery.sap.properties(); // TODO detect: jQuery.sap.properties is deprecated -}); diff --git a/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap.js b/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap.js new file mode 100644 index 000000000..cb3075d78 --- /dev/null +++ b/test/fixtures/linter/rules/NoDeprecatedApi/jQuery.sap.js @@ -0,0 +1,17 @@ +sap.ui.define(["sap/ui/thirdparty/jquery", "jquery.sap.properties"], function(importedJQuery, importedJQuerySapProperties) { + + // Global access + var oProperties1 = jQuery.sap.properties(); // jQuery.sap.properties is deprecated + var oProperties2 = jQuery["sap"].properties(); // jQuery.sap.properties is deprecated + var oProperties3 = jQuery["sap"]["properties"](); // jQuery.sap.properties is deprecated + + // via thirdparty jQuery + var oProperties1 = importedJQuery.sap.properties(); // jQuery.sap.properties is deprecated + var oProperties2 = importedJQuery["sap"].properties(); // jQuery.sap.properties is deprecated + var oProperties3 = importedJQuery["sap"]["properties"](); // jQuery.sap.properties is deprecated + + // via jquery.sap module + var oProperties1 = importedJQuerySapProperties.sap.properties(); // jQuery.sap.properties is deprecated + var oProperties2 = importedJQuerySapProperties["sap"].properties(); // jQuery.sap.properties is deprecated + var oProperties3 = importedJQuerySapProperties["sap"]["properties"](); // jQuery.sap.properties is deprecated +}); diff --git a/test/fixtures/linter/rules/NoGlobals/NoGlobals.js b/test/fixtures/linter/rules/NoGlobals/NoGlobals.js index 432bb5131..ae107ec79 100644 --- a/test/fixtures/linter/rules/NoGlobals/NoGlobals.js +++ b/test/fixtures/linter/rules/NoGlobals/NoGlobals.js @@ -26,7 +26,7 @@ sap.ui.define(["sap/ui/core/mvc/Controller"], jQuery.ajax(); // ERROR: Global third-party variable "jQuery" jQuery("#foo"); // ERROR: Global third-party variable "jQuery" - jQuery.sap.require(); // ERROR: Global variable "jQuery.sap" + jQuery.sap.require(); // ERROR: Global + deprecated variable "jQuery.sap" QUnit.test(); // OK: Global third-party variable "QUnit" sinon.stub(); // OK: Global third-party variable "sinon" diff --git a/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md b/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md index d02a5430f..f25c9cd98 100644 --- a/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md +++ b/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md @@ -636,7 +636,7 @@ Generated by [AVA](https://avajs.dev). }, ] -## General: jQuery.sap-global.js +## General: jQuery.sap.js > Snapshot 1 @@ -645,68 +645,145 @@ Generated by [AVA](https://avajs.dev). coverageInfo: [ { category: 1, - column: 20, - line: 2, + column: 21, + line: 4, message: 'Unable to analyze this method call because the type of identifier "properties" in "jQuery.sap.properties()"" could not be determined', }, + { + category: 1, + column: 21, + line: 5, + message: 'Unable to analyze this method call because the type of identifier "properties" in "jQuery["sap"].properties()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 6, + message: 'Unable to analyze this method call because the type of identifier in "jQuery["sap"]["properties"]()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 9, + message: 'Unable to analyze this method call because the type of identifier "properties" in "importedJQuery.sap.properties()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 10, + message: 'Unable to analyze this method call because the type of identifier "properties" in "importedJQuery["sap"].properties()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 11, + message: 'Unable to analyze this method call because the type of identifier in "importedJQuery["sap"]["properties"]()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 14, + message: 'Unable to analyze this method call because the type of identifier "properties" in "importedJQuerySapProperties.sap.properties()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 15, + message: 'Unable to analyze this method call because the type of identifier "properties" in "importedJQuerySapProperties["sap"].properties()"" could not be determined', + }, + { + category: 1, + column: 21, + line: 16, + message: 'Unable to analyze this method call because the type of identifier in "importedJQuerySapProperties["sap"]["properties"]()"" could not be determined', + }, ], - errorCount: 1, + errorCount: 9, fatalErrorCount: 0, - filePath: 'jQuery.sap-global.js', + filePath: 'jQuery.sap.js', messages: [ { - column: 20, + column: 21, fatal: undefined, - line: 2, - message: 'Access of global variable \'jQuery\' (jQuery.sap.properties)', - ruleId: 'ui5-linter-no-globals-js', + line: 4, + message: 'Use of deprecated API \'jQuery.sap.properties\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', severity: 2, }, - ], - warningCount: 0, - }, - ] - -## General: jQuery.sap-jquery.js - -> Snapshot 1 - - [ - { - coverageInfo: [ { - category: 1, - column: 20, - line: 2, - message: 'Unable to analyze this method call because the type of identifier "properties" in "jQuery.sap.properties()"" could not be determined', + column: 21, + fatal: undefined, + line: 5, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, }, - ], - errorCount: 0, - fatalErrorCount: 0, - filePath: 'jQuery.sap-jquery.js', - messages: [], - warningCount: 0, - }, - ] - -## General: jQuery.sap-module.js - -> Snapshot 1 - - [ - { - coverageInfo: [ { - category: 1, - column: 20, - line: 2, - message: 'Unable to analyze this method call because the type of identifier "properties" in "jQuery.sap.properties()"" could not be determined', + column: 21, + fatal: undefined, + line: 6, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 9, + message: 'Use of deprecated API \'importedJQuery.sap.properties\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 10, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 11, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 14, + message: 'Use of deprecated API \'importedJQuerySapProperties.sap.properties\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 15, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, + }, + { + column: 21, + fatal: undefined, + line: 16, + message: 'Use of deprecated API \'jQuery.sap\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', + severity: 2, }, ], - errorCount: 0, - fatalErrorCount: 0, - filePath: 'jQuery.sap-module.js', - messages: [], warningCount: 0, }, ] diff --git a/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap b/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap index a9eec832d8752f16b361b85132e7bb018dbbcfd7..988be851f4b308560b26622d2ba7e284c7653a6c 100644 GIT binary patch literal 4952 zcmV-e6Q}G!RzVCndZu~sVf_=TkPZN5098V%5c0fe zRO=IBpj1{?h6o@8qDY9t284X;feparz<2)zNIXb6u5GQ}ZVD+`EH5udlpqvD zsSryAR0|J6t`NoTkzPHjb?HZiJ0plPs)RIfEucrEk?4X*JZ#$k<+ZA^%^hW(nyH13 zaNLIDF16DL=}R?pO;XGOlU=LOpjxTjdMu`O=`qKXiq~t=uo3Rs_GRie_<6R$PZiSn z0xl8Tg6z!<^3@^%vig#M*93Sa2ug661eZwgv;^fI2hegF&^|}SmG(#|-W^WBSnjwg z+c4UH`AQtuydfj34*|a~0n@(dekuc65lK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fZpUQjYAM5R*RI<&>mKRt&M7DNPb@e1r;mw)*)?M7T~2$G z`>5^j*n0P)DHYpueV)_zJlo!C(TuN+t%)pY9&zda%^laJluw@^wK zS5<}K&J}P>sVRNy6f@k}g~4+B7N4Sxbl)@nNM2+N4cnvRjpub$8P6jGtSogrKQP7P zIj+-xfR_cS!y+sQzDY!es3-^NGJ83!n>MirV{uNKHFYAgK3ESx3 zm)}j_NBbdH$j{ox!>g+MAxjzITnYYmPuAa@{n~yZpg#S{=Tj>A0d+6utke>^14-(e z@wOw!^ETTWjv6CI;TosBtSbJtZ@$A(DSta;e8j5x9S$LVM!@Z*dEC8Ok9%FfuLLwm juvmgqCAdj~?-r5-?W^to{p5@XlE?i&TnW?+7=!=-EOCI& diff --git a/test/lib/linter/rules/snapshots/NoGlobals.ts.md b/test/lib/linter/rules/snapshots/NoGlobals.ts.md index 5b61b0c72..b5fa2c06d 100644 --- a/test/lib/linter/rules/snapshots/NoGlobals.ts.md +++ b/test/lib/linter/rules/snapshots/NoGlobals.ts.md @@ -154,8 +154,9 @@ Generated by [AVA](https://avajs.dev). column: 4, fatal: undefined, line: 29, - message: 'Access of global variable \'jQuery\' (jQuery.sap.require)', - ruleId: 'ui5-linter-no-globals-js', + message: 'Use of deprecated API \'jQuery.sap.require\'', + messageDetails: 'Deprecated test message', + ruleId: 'ui5-linter-no-deprecated-api', severity: 2, }, ], diff --git a/test/lib/linter/rules/snapshots/NoGlobals.ts.snap b/test/lib/linter/rules/snapshots/NoGlobals.ts.snap index c8de38df7c24e8903f99483b07ffe75e5e7a7618..c0d1f72e1a43d6ecd084b90d647a64a45eef7079 100644 GIT binary patch literal 1596 zcmV-C2E+M5RzVR-@Gt++-) zs;JstG&|m1>@%syiekkUd-cva=Xc)uJ!f{#yL(<;Y+6q1d)^ZlrEmI{>>ZP~bPelk z`U&TlS z3-K?F;W{1~1EB@sxqdhngwOTE@gRJ+AI5_4lYSTv!h?OUi6DG1upQ({2Ms?TALe;~ ze3U018|66~8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