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 isStandardSyntaxFunction false positives for interpolation and backticks in CSS-in-JS #6565

Merged
merged 3 commits into from Jan 10, 2023

Conversation

hudochenkov
Copy link
Member

@hudochenkov hudochenkov commented Jan 8, 2023

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

Fixes #6564

Is there anything in the PR that needs further explanation?

Tests for the rule are skipped, because there is no CSS-in-JS syntax added to the repo yet. Waiting for #6556.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2023

🦋 Changeset detected

Latest commit: 221dbaa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

Thanks for creating the pull request. If addressing my reviews, it may be good to update the PR title like this:

Fix `isStandardSyntaxFunction` false positives for interpolation and backticks in CSS-in-JS

lib/rules/function-no-unknown/__tests__/index.js Outdated Show resolved Hide resolved
lib/utils/__tests__/isStandardSyntaxFunction.test.js Outdated Show resolved Hide resolved
@hudochenkov hudochenkov changed the title Fix function-no-unknown false positives for interpolation and backticks in CSS-in-JS. Fixes #6564 Fix isStandardSyntaxFunction false positives for interpolation and backticks in CSS-in-JS. Fixes #6564 Jan 9, 2023
@hudochenkov
Copy link
Member Author

@ybiquitous I agree with your suggestion. I've updated PR title, but I don't think we need to mention internal function in a changelog. Because users don't care about internal functions, but they care about rules.

@ybiquitous ybiquitous changed the title Fix isStandardSyntaxFunction false positives for interpolation and backticks in CSS-in-JS. Fixes #6564 Fix isStandardSyntaxFunction false positives for interpolation and backticks in CSS-in-JS Jan 10, 2023
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.

Agreed. LGTM. Thank you 👍🏼

it('CSS-in-JS interpolation', () => {
expect(
isStandardSyntaxFunction(
getFunction('${({ size }) => (size === "small") ? "0.8em" : "1em"}'),
Copy link
Contributor

Choose a reason for hiding this comment

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

this is great, exactly what i was getting at in the other issue - a generic test for all css-in-js function nodes.

nice work 🎉

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.

function-no-unknown false positives for interpolation and backticks in CSS-in-JS
3 participants