Linter: Implement html-validate-elements-attributes linter rule#357
Draft
Linter: Implement html-validate-elements-attributes linter rule#357
html-validate-elements-attributes linter rule#357Conversation
a98b1c1 to
d406431
Compare
d406431 to
de72fe1
Compare
| } | ||
|
|
||
| if (value.startsWith('mailto:') || value.startsWith('tel:') || value.startsWith('sms:') || | ||
| value.startsWith('data:') || value.startsWith('javascript:')) { |
Check failure
Code scanning / CodeQL
Incomplete URL scheme check High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we should update the conditional on line 159-160 to include vbscript: in the list of schemes that are considered valid. This means adding value.startsWith('vbscript:') to the conditional. This change should be made in the file javascript/packages/linter/src/rules/utils/html-attribute-value-validators.ts, specifically in the block starting at line 159. No additional imports or definitions are required, as this is a simple string comparison.
Suggested changeset
1
javascript/packages/linter/src/rules/utils/html-attribute-value-validators.ts
| @@ -157,7 +157,7 @@ | ||
| } | ||
|
|
||
| if (value.startsWith('mailto:') || value.startsWith('tel:') || value.startsWith('sms:') || | ||
| value.startsWith('data:') || value.startsWith('javascript:')) { | ||
| value.startsWith('data:') || value.startsWith('javascript:') || value.startsWith('vbscript:')) { | ||
| return { valid: true } | ||
| } | ||
|
|
Copilot is powered by AI and may make mistakes. Always verify output.
html-validate-elements-attributes linter rulehtml-validate-elements-attributes linter rule
html-validate-elements-attributes linter rulehtml-validate-elements-attributes linter rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.