diff --git a/src/linter/ui5Types/amdTranspiler/tsTransformer.ts b/src/linter/ui5Types/amdTranspiler/tsTransformer.ts index 509a551e..5ee248b8 100644 --- a/src/linter/ui5Types/amdTranspiler/tsTransformer.ts +++ b/src/linter/ui5Types/amdTranspiler/tsTransformer.ts @@ -283,7 +283,9 @@ function transform( metadata.transformedImports = new Map>(); } const curResource = metadata.transformedImports.get(importType) ?? new Set(); - curResource.add(importStatement.moduleSpecifier.getText()); + if (ts.isStringLiteral(importStatement.moduleSpecifier)) { + curResource.add(importStatement.moduleSpecifier.text); + } metadata.transformedImports.set(importType, curResource); } diff --git a/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md b/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md index 3382b06a..59d2c53e 100644 --- a/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md +++ b/test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md @@ -567,8 +567,17 @@ Generated by [AVA](https://avajs.dev). errorCount: 0, fatalErrorCount: 0, filePath: 'Configuration.beforeBootstrap.qunit.js', - messages: [], - warningCount: 0, + messages: [ + { + column: 1, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 1, }, ] @@ -2947,8 +2956,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-deprecated-theme', severity: 2, }, + { + column: 9, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 0, + warningCount: 1, }, ] @@ -3027,8 +3044,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-deprecated-theme', severity: 2, }, + { + column: 9, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 0, + warningCount: 1, }, ] diff --git a/test/lib/linter/snapshots/linter.ts.md b/test/lib/linter/snapshots/linter.ts.md index f220a530..cbf1287f 100644 --- a/test/lib/linter/snapshots/linter.ts.md +++ b/test/lib/linter/snapshots/linter.ts.md @@ -849,8 +849,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [ @@ -954,8 +962,25 @@ Generated by [AVA](https://avajs.dev). errorCount: 0, fatalErrorCount: 0, filePath: 'webapp/test/testsuite.qunit.js', - messages: [], - warningCount: 0, + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, }, { coverageInfo: [], @@ -1042,8 +1067,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -1455,8 +1488,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -1481,6 +1521,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -1552,8 +1615,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -3014,8 +3084,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], diff --git a/test/lib/snapshots/index.ts.md b/test/lib/snapshots/index.ts.md index 8652eabd..49fa0e56 100644 --- a/test/lib/snapshots/index.ts.md +++ b/test/lib/snapshots/index.ts.md @@ -309,8 +309,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -335,6 +342,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -406,8 +436,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -755,8 +792,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -781,6 +825,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -852,8 +919,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -1281,8 +1355,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [ @@ -1386,8 +1468,25 @@ Generated by [AVA](https://avajs.dev). errorCount: 0, fatalErrorCount: 0, filePath: 'webapp/test/testsuite.qunit.js', - messages: [], - warningCount: 0, + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, }, { coverageInfo: [], @@ -1475,8 +1574,16 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + messageDetails: 'Test Starter (https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb)', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -1853,8 +1960,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -1879,6 +1993,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -1950,8 +2087,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -2299,8 +2443,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -2325,6 +2476,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -2396,8 +2570,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -2745,8 +2926,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 7, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [], @@ -2771,6 +2959,29 @@ Generated by [AVA](https://avajs.dev). ], warningCount: 2, }, + { + coverageInfo: [], + errorCount: 0, + fatalErrorCount: 0, + filePath: 'webapp/test/testsuite.qunit.js', + messages: [ + { + column: 14, + line: 3, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + { + column: 1, + line: 2, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, + ], + warningCount: 2, + }, { coverageInfo: [], errorCount: 1, @@ -2842,8 +3053,15 @@ Generated by [AVA](https://avajs.dev). ruleId: 'no-globals', severity: 2, }, + { + column: 18, + line: 9, + message: 'To save boilerplate code and ensure compliance with UI5 2.x best practices, please migrate to the Test Starter concept', + ruleId: 'prefer-test-starter', + severity: 1, + }, ], - warningCount: 1, + warningCount: 2, }, { coverageInfo: [],