Skip to content

Commit 4fb76f8

Browse files
authored
fix: Detect outdated notation for bootstrap attribute log-level (#603)
Fixes #602
1 parent 4f63503 commit 4fb76f8

File tree

14 files changed

+165
-27
lines changed

14 files changed

+165
-27
lines changed

src/linter/html/transpiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const oldToNewAttr = new Map([
102102
["data-sap-ui-compatversion", "data-sap-ui-compat-version"],
103103
["data-sap-ui-flexibilityservices", "data-sap-ui-flexibility-services"],
104104
["data-sap-ui-frameoptions", "data-sap-ui-frame-options"],
105+
["data-sap-ui-loglevel", "data-sap-ui-log-level"],
105106
["data-sap-ui-evt-oninit", "data-sap-ui-on-init"],
106107
["data-sap-ui-oninit", "data-sap-ui-on-init"],
107108
["data-sap-ui-resourceroots", "data-sap-ui-resource-roots"],

test/e2e/snapshots/compare-snapshots.ts.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,15 @@ Generated by [AVA](https://avajs.dev).
176176
ruleId: 'no-deprecated-api',
177177
severity: 1,
178178
},
179+
{
180+
column: 4,
181+
line: 25,
182+
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-logLevel\'; should be written as \'data-sap-ui-log-level\'',
183+
ruleId: 'no-deprecated-api',
184+
severity: 1,
185+
},
179186
],
180-
warningCount: 4,
187+
warningCount: 5,
181188
},
182189
{
183190
errorCount: 0,
@@ -212,8 +219,15 @@ Generated by [AVA](https://avajs.dev).
212219
ruleId: 'no-deprecated-api',
213220
severity: 1,
214221
},
222+
{
223+
column: 4,
224+
line: 24,
225+
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-logLevel\'; should be written as \'data-sap-ui-log-level\'',
226+
ruleId: 'no-deprecated-api',
227+
severity: 1,
228+
},
215229
],
216-
warningCount: 4,
230+
warningCount: 5,
217231
},
218232
{
219233
errorCount: 5,
@@ -296,8 +310,15 @@ Generated by [AVA](https://avajs.dev).
296310
ruleId: 'no-deprecated-api',
297311
severity: 1,
298312
},
313+
{
314+
column: 4,
315+
line: 21,
316+
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-logLevel\'; should be written as \'data-sap-ui-log-level\'',
317+
ruleId: 'no-deprecated-api',
318+
severity: 1,
319+
},
299320
],
300-
warningCount: 4,
321+
warningCount: 5,
301322
},
302323
{
303324
errorCount: 3,
@@ -416,8 +437,15 @@ Generated by [AVA](https://avajs.dev).
416437
ruleId: 'no-deprecated-api',
417438
severity: 1,
418439
},
440+
{
441+
column: 4,
442+
line: 18,
443+
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-logLevel\'; should be written as \'data-sap-ui-log-level\'',
444+
ruleId: 'no-deprecated-api',
445+
severity: 1,
446+
},
419447
],
420-
warningCount: 3,
448+
warningCount: 4,
421449
},
422450
{
423451
errorCount: 3,
162 Bytes
Binary file not shown.

test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/index-cdn.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
data-sap-ui-frameOptions="trusted"
2323
data-sap-ui-xx-waitForTheme="true"
2424
data-sap-ui-xx-supportedLanguages="en,de"
25+
data-sap-ui-logLevel="INFO"
2526
></script>
2627
</head>
2728

test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
data-sap-ui-frameOptions="trusted"
2222
data-sap-ui-xx-waitForTheme="true"
2323
data-sap-ui-xx-supportedLanguages="en,de"
24+
data-sap-ui-logLevel="INFO"
2425
></script>
2526
</head>
2627

test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/integration/opaTests.qunit.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
data-sap-ui-compatVersion="edge"
1919
data-sap-ui-async="true"
2020
data-sap-ui-oninit="module:integration/opaTests.qunit"
21+
data-sap-ui-logLevel="INFO"
2122
></script>
2223
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css" />
2324
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>

test/fixtures/linter/projects/com.ui5.troublesome.app/webapp/test/unit/unitTests.qunit.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
}'
1616
data-sap-ui-async="true"
1717
data-sap-ui-oninit="module:unit/unitTests.qunit"
18+
data-sap-ui-logLevel="INFO"
1819
></script>
1920
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css" />
2021
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>

test/fixtures/linter/rules/NoDeprecatedApi/BootstrapParameters_Warnings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
data-sap-ui-frameoptions="allow"
1414
data-sap-ui-evt-oninit="console.log('Ready')"
1515
data-sap-ui-onInit="console.log('Ready')"
16+
data-sap-ui-logLevel="INFO"
1617
data-sap-ui-resourceroots='{"sap.ui.demo.todo": "./"}'
1718

1819
data-sap-ui-bindingsyntax="complex"
@@ -22,7 +23,6 @@
2223
data-sap-ui-xx-preload="async"
2324

2425
data-sap-ui-xx-noless="true"
25-
2626
data-sap-ui-xx-waitForTheme="true">
2727
</script>
2828
</head>

test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,64 +464,71 @@ Generated by [AVA](https://avajs.dev).
464464
{
465465
column: 3,
466466
line: 16,
467+
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-logLevel\'; should be written as \'data-sap-ui-log-level\'',
468+
ruleId: 'no-deprecated-api',
469+
severity: 1,
470+
},
471+
{
472+
column: 3,
473+
line: 17,
467474
message: 'Outdated spelling of bootstrap parameter: \'data-sap-ui-resourceroots\'; should be written as \'data-sap-ui-resource-roots\'',
468475
ruleId: 'no-deprecated-api',
469476
severity: 1,
470477
},
471478
{
472479
column: 3,
473-
line: 18,
480+
line: 19,
474481
message: 'Redundant bootstrap parameter \'data-sap-ui-bindingsyntax\' should be removed',
475482
messageDetails: 'Only \'complex\' is supported with UI5 2.x and automatically enforced by the UI5 runtime. Complex binding parser supports simple binding syntax per default.',
476483
ruleId: 'no-deprecated-api',
477484
severity: 1,
478485
},
479486
{
480487
column: 3,
481-
line: 19,
488+
line: 20,
482489
message: 'Duplicate bootstrap parameter \'data-sap-ui-binding-syntax\' with value \'complex\'',
483490
ruleId: 'no-deprecated-api',
484491
severity: 1,
485492
},
486493
{
487494
column: 3,
488-
line: 19,
495+
line: 20,
489496
message: 'Redundant bootstrap parameter \'data-sap-ui-xx-bindingsyntax\' should be removed',
490497
messageDetails: 'Only \'complex\' is supported with UI5 2.x and automatically enforced by the UI5 runtime. Complex binding parser supports simple binding syntax per default.',
491498
ruleId: 'no-deprecated-api',
492499
severity: 1,
493500
},
494501
{
495502
column: 3,
496-
line: 20,
503+
line: 21,
497504
message: 'Duplicate bootstrap parameter \'data-sap-ui-binding-syntax\' with value \'complex\'',
498505
ruleId: 'no-deprecated-api',
499506
severity: 1,
500507
},
501508
{
502509
column: 3,
503-
line: 20,
510+
line: 21,
504511
message: 'Redundant bootstrap parameter \'data-sap-ui-xx-binding-syntax\' should be removed',
505512
messageDetails: 'Only \'complex\' is supported with UI5 2.x and automatically enforced by the UI5 runtime. Complex binding parser supports simple binding syntax per default.',
506513
ruleId: 'no-deprecated-api',
507514
severity: 1,
508515
},
509516
{
510517
column: 3,
511-
line: 22,
518+
line: 23,
512519
message: 'Duplicate bootstrap parameter \'data-sap-ui-preload\' with value \'async\'',
513520
ruleId: 'no-deprecated-api',
514521
severity: 1,
515522
},
516523
{
517524
column: 3,
518-
line: 24,
525+
line: 25,
519526
message: 'Abandoned bootstrap parameter \'data-sap-ui-xx-noless\' should be removed',
520527
ruleId: 'no-deprecated-api',
521528
severity: 1,
522529
},
523530
],
524-
warningCount: 14,
531+
warningCount: 15,
525532
},
526533
]
527534

9 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)