-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add autofix for attr-value-no-duplication rule
#339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
coliff
merged 2 commits into
main
from
dev/coliff/add-attr-value-no-duplication-autofix
Nov 26, 2025
+176
−5
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Attribute No Duplication Test</title> | ||
| </head> | ||
| <body> | ||
| <!-- Test case 1: Duplicate attributes with same value (should be fixed) --> | ||
| <div class="btn" class="btn">Button 1</div> | ||
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
|
||
|
|
||
| <!-- Test case 2: Duplicate attributes with different values (should NOT be fixed) --> | ||
| <div id="test1" id="test2">Button 2</div> | ||
|
|
||
| <!-- Test case 3: Multiple duplicate attributes with same values (should be fixed) --> | ||
| <div class="primary" data-test="value" class="primary" data-test="value">Button 3</div> | ||
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
|
||
|
|
||
| <!-- Test case 4: Mixed case attribute names with same values (should be fixed) --> | ||
| <div CLASS="btn" class="btn">Button 4</div> | ||
|
|
||
| <!-- Test case 5: Duplicate attributes with empty values (should be fixed) --> | ||
| <div data-empty="" data-empty="">Button 5</div> | ||
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
|
||
|
|
||
| <!-- Test case 6: No duplicates - should not trigger --> | ||
| <div class="btn" id="unique">Button 6</div> | ||
|
|
||
| <!-- Test case 7: Self-closing tag with duplicates --> | ||
| <input type="text" name="test" type="text" /> | ||
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
|
||
|
|
||
| <!-- Test case 8: Multiple spaces around duplicate attributes --> | ||
| <div class="btn" class="btn" >Button 8</div> | ||
coliff marked this conversation as resolved.
Dismissed
Show dismissed
Hide dismissed
|
||
| </body> | ||
| </html> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Attribute Value No Duplication Test</title> | ||
| </head> | ||
| <body> | ||
| <!-- Test case 1: Duplicate values in class attribute (should be fixed) --> | ||
| <div class="btn btn primary">Button 1</div> | ||
|
|
||
| <!-- Test case 2: Multiple duplicates in class attribute (should be fixed) --> | ||
| <div class="btn primary btn secondary primary">Button 2</div> | ||
|
|
||
| <!-- Test case 3: No duplicates - should not trigger --> | ||
| <div class="btn primary secondary">Button 3</div> | ||
|
|
||
| <!-- Test case 4: Single class value - should not trigger --> | ||
| <div class="btn">Button 4</div> | ||
|
|
||
| <!-- Test case 5: Empty class - should not trigger --> | ||
| <div class="">Button 5</div> | ||
|
|
||
| <!-- Test case 6: Duplicate values with extra whitespace --> | ||
| <div class=" btn btn primary ">Button 6</div> | ||
|
|
||
| <!-- Test case 7: Other attributes that might have duplicate values --> | ||
| <div data-tags="tag1 tag2 tag1 tag3">Button 7</div> | ||
|
|
||
| <!-- Test case 8: Mixed case duplicates (case-sensitive) --> | ||
| <div class="btn Btn BTN">Button 8</div> | ||
| </body> | ||
| </html> |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.