diff --git a/src/linter/html/linter.ts b/src/linter/html/linter.ts index 0c32cfdc2..6ed3e38ed 100644 --- a/src/linter/html/linter.ts +++ b/src/linter/html/linter.ts @@ -28,10 +28,10 @@ export async function lintHtml(resourceName: string, contentStream: ReadStream): if (scriptContent) { report.addMessage({ node: tag, - severity: LintMessageSeverity.Error, - ruleId: "ui5-linter-csp-compliance", - message: `Use of inline javascript`, - messageDetails: "In order to avoid CSP errors, remove the usage of inline javascript", + severity: LintMessageSeverity.Warning, + ruleId: "ui5-linter-csp-unsafe-inline-script", + message: `Use of unsafe inline script`, + messageDetails: "{@link topic:fe1a6dba940e479fb7c3bc753f92b28c Content Security Policy}", }); } }); diff --git a/test/lib/linter/rules/snapshots/CSPCompliance.ts.md b/test/lib/linter/rules/snapshots/CSPCompliance.ts.md index da3befcdc..581367b23 100644 --- a/test/lib/linter/rules/snapshots/CSPCompliance.ts.md +++ b/test/lib/linter/rules/snapshots/CSPCompliance.ts.md @@ -11,7 +11,7 @@ Generated by [AVA](https://avajs.dev). [ { coverageInfo: [], - errorCount: 3, + errorCount: 0, fatalErrorCount: 0, filePath: 'NoInlineJS.html', messages: [ @@ -19,31 +19,31 @@ Generated by [AVA](https://avajs.dev). column: 2, fatal: undefined, line: 9, - message: 'Use of inline javascript', - messageDetails: 'In order to avoid CSP errors, remove the usage of inline javascript', - ruleId: 'ui5-linter-csp-compliance', - severity: 2, + message: 'Use of unsafe inline script', + messageDetails: 'Content Security Policy (https://ui5.sap.com/1.120/#/topic/fe1a6dba940e479fb7c3bc753f92b28c)', + ruleId: 'ui5-linter-csp-unsafe-inline-script', + severity: 1, }, { column: 2, fatal: undefined, line: 17, - message: 'Use of inline javascript', - messageDetails: 'In order to avoid CSP errors, remove the usage of inline javascript', - ruleId: 'ui5-linter-csp-compliance', - severity: 2, + message: 'Use of unsafe inline script', + messageDetails: 'Content Security Policy (https://ui5.sap.com/1.120/#/topic/fe1a6dba940e479fb7c3bc753f92b28c)', + ruleId: 'ui5-linter-csp-unsafe-inline-script', + severity: 1, }, { column: 2, fatal: undefined, line: 23, - message: 'Use of inline javascript', - messageDetails: 'In order to avoid CSP errors, remove the usage of inline javascript', - ruleId: 'ui5-linter-csp-compliance', - severity: 2, + message: 'Use of unsafe inline script', + messageDetails: 'Content Security Policy (https://ui5.sap.com/1.120/#/topic/fe1a6dba940e479fb7c3bc753f92b28c)', + ruleId: 'ui5-linter-csp-unsafe-inline-script', + severity: 1, }, ], - warningCount: 0, + warningCount: 3, }, ] diff --git a/test/lib/linter/rules/snapshots/CSPCompliance.ts.snap b/test/lib/linter/rules/snapshots/CSPCompliance.ts.snap index d24b85134..67493d801 100644 Binary files a/test/lib/linter/rules/snapshots/CSPCompliance.ts.snap and b/test/lib/linter/rules/snapshots/CSPCompliance.ts.snap differ