Skip to content
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

Fix false positives for interpolation in keyframes-name-pattern #6265

Merged
merged 5 commits into from Aug 16, 2022
Merged

Fix false positives for interpolation in keyframes-name-pattern #6265

merged 5 commits into from Aug 16, 2022

Conversation

a-sokolova-dev
Copy link
Contributor

Which issue, if any, is this issue related to?

Closes #5997

Is there anything in the PR that needs further explanation?

No, it's self-explanatory.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-falkonia Thanks for opening the pull request. It's looking good.

I've requested some minor changes.

@@ -38,6 +39,10 @@ const rule = (primary) => {
return;
}

if (!isStandardSyntaxKeyframesName(value)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to before the first conditionally as we normally check that things are standard before any other operation.


describe('isStandardSyntaxKeyframesName', () => {
it('standard name', () => {
expect(isStandardSyntaxKeyframesName('@keyframes slidein {}')).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(isStandardSyntaxKeyframesName('@keyframes slidein {}')).toBeTruthy();
expect(isStandardSyntaxKeyframesName('slidein')).toBeTruthy();

As the util is checking the keyframes-name, and not the whole @keyframe.

We'll need to update the other tests too.

*/

module.exports = function (keyframesName) {
// SCSS or Less interpolation
Copy link
Member

@jeddy3 jeddy3 Aug 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SCSS or Less interpolation

We can lose the comment. (The hasInterpolation util checks for more than just Less or Sass interpolation).

@jeddy3 jeddy3 changed the title Fix false positives for interpolation in keyframes-name-pattern #5997 Fix false positives for interpolation in keyframes-name-pattern Aug 14, 2022
@a-sokolova-dev
Copy link
Contributor Author

@jeddy3 Thank you for your review!
I've made the required changes, hope everything looks good now.

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-falkonia Thanks for creating the PR!

I've left some refactoring suggestions, but the change looks almost good. 👍🏼

lib/utils/__tests__/isStandardSyntaxKeyframesName.test.js Outdated Show resolved Hide resolved
lib/utils/isStandardSyntaxKeyframesName.js Outdated Show resolved Hide resolved
lib/utils/isStandardSyntaxKeyframesName.js Outdated Show resolved Hide resolved
@a-sokolova-dev
Copy link
Contributor Author

@ybiquitous Thank you! I've made the updates.

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM 👍🏼

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-falkonia Thanks for making the changes. All most there.

I've requested one set of minor changes to the tests.


describe('isStandardSyntaxKeyframesName', () => {
it('standard name', () => {
expect(isStandardSyntaxKeyframesName('slidein {}')).toBe(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(isStandardSyntaxKeyframesName('slidein {}')).toBe(true);
expect(isStandardSyntaxKeyframesName('slidein')).toBe(true);

We're only testing the name, not the block. We'll need to remove the block from the other tests too.

@a-sokolova-dev
Copy link
Contributor Author

@jeddy3 So so sorry for missing this. All the blocks should be removed now.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jeddy3
Copy link
Member

jeddy3 commented Aug 16, 2022

Changelog entry added:

  • Fixed: keyframes-name-pattern false positives for interpolation (#6265).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix false positives for interpolation in keyframes-name-pattern
3 participants