Repository navigation
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Normalize comparisons and validate equivalent selectors src/rules/no-duplicate-keyframe-selectors.js, tests/rules/no-duplicate-keyframe-selectors.test.js, docs/rules/no-duplicate-keyframe-selectors.md |
The rule normalizes percentage values for duplicate comparisons and retains the original selector values for reports. Tests cover equivalent numeric forms, from/to aliases, comma-separated selectors, and entry selectors. The valid fixture and rule documentation reflect the behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested labels: bug
Suggested reviewers: pixel998
Merge Risk: 
Minimal · up to e9dfd
-
The change detects numerically equivalent percentage selectors and adds corresponding tests and documentation. No concrete merge-blocking risk is identified.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
| }, | ||
| ], | ||
| }, | ||
| { |
There was a problem hiding this comment.
Can you please also add a test case with a trailing ".", for example:
1% and 1.%?
There was a problem hiding this comment.
1.% isn't a valid percentage, so it's a parsing error.
| // @ts-ignore - children is a valid property for prelude | ||
| node.prelude.children.forEach(selector => { | ||
| const value = []; | ||
| const keyParts = []; |
There was a problem hiding this comment.
What is the purpose of keyParts?
Why could we not push the normalized value directly into the value array?
There was a problem hiding this comment.
value builds the error message, which shows the selector as written ('0.0%', 'From'). keyParts holds the normalized form used for the duplicate check. Pushing the normalized value into value would make the message for 0.0% say '0%'.
There was a problem hiding this comment.
Could you add a short comment?
Prerequisites checklist
AI acknowledgment
What did you do?
What did you expect to happen?
0.0%is reported as a duplicate of0%.What actually happened?
No problems were reported.
What is the purpose of this pull request?
Different spellings of the same percentage, like
0%and0.0%, select the same keyframe, so the later block overrides the earlier one. The rule compared them as text and didn't report them.What changes did you make? (Give an overview)
Number(component.value)instead of their source text.Related Issues
Is there anything you'd like reviewers to focus on?
Summary by CodeRabbit
0%and0.0%. This also applies to equivalent forms used withfrom,to, comma-separated selectors, and prefixedentryselectors.fromandtoaliases. Reported selector text retains its original spelling.