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 selector-max-type end positions #7518

Merged

Conversation

romainmenke
Copy link
Member

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

See : #6234
See : #7509

Is there anything in the PR that needs further explanation?

No, it's self-explanatory.

Copy link

changeset-bot bot commented Feb 6, 2024

🦋 Changeset detected

Latest commit: edbe05e

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

@romainmenke romainmenke changed the title Fix inaccurate end positions in selector-max-type Fix inaccurate end positions in selector-max-type (non-breaking) Feb 6, 2024
Comment on lines -42 to -44
{
code: '.foo { [&] {} }',
},
Copy link
Member Author

Choose a reason for hiding this comment

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

This selector is still bogus as explained in : https://github.com/stylelint/stylelint/pull/7509/files#r1474906773

Copy link
Contributor

@Mouvedia Mouvedia Feb 6, 2024

Choose a reason for hiding this comment

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

ref https://stackoverflow.com/q/925994/248058
i.e. it's not a valid attribute name hence it will produce an SCSS error

lib/utils/flattenNestedSelectorsForRule.cjs Outdated Show resolved Hide resolved
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.

@romainmenke Thanks for the pull request. Can you go on? I think this PR can be released as a patch version.

@romainmenke romainmenke marked this pull request as ready for review March 17, 2024 17:52
@romainmenke romainmenke changed the title Fix inaccurate end positions in selector-max-type (non-breaking) Fix inaccurate end positions in selector-max-type Mar 17, 2024
@romainmenke

This comment was marked as resolved.

Copy link
Contributor

@Mouvedia Mouvedia left a comment

Choose a reason for hiding this comment

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

note

I wonder why there's no ignore option for the subsequent/general sibling combinator.

lib/rules/selector-max-type/index.mjs Outdated Show resolved Hide resolved
lib/utils/getSelectorAST.mjs Outdated Show resolved Hide resolved
@ybiquitous
Copy link
Member

I wonder why there's no ignore option for the subsequent/general sibling combinator.

I'm unsure, but I guess there are no requests from people.

@ybiquitous ybiquitous changed the title Fix inaccurate end positions in selector-max-type Fix selector-max-type end positions Mar 19, 2024
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
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.

I've left several refactoring suggestions, so can you take a look at them?

lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/flattenNestedSelectorsForRule.mjs Outdated Show resolved Hide resolved
lib/utils/getSelectorAST.mjs Outdated Show resolved Hide resolved
romainmenke and others added 4 commits March 19, 2024 19:39
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@ybiquitous ybiquitous mentioned this pull request Mar 21, 2024
4 tasks
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.

Great work! Thank you! 👍🏼

@ybiquitous
Copy link
Member

@Mouvedia Do you have any other thoughts?

Copy link
Contributor

@Mouvedia Mouvedia left a comment

Choose a reason for hiding this comment

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

@Mouvedia Do you have any other thoughts?

Not much.
LGTM

lib/utils/__tests__/parseSelectorAST.test.mjs Outdated Show resolved Hide resolved
lib/utils/__tests__/parseSelectorAST.test.mjs Show resolved Hide resolved
lib/utils/__tests__/parseSelectorAST.test.mjs Show resolved Hide resolved
@romainmenke
Copy link
Member Author

Thank you @ybiquitous, @Mouvedia for all the feedback and help 🙇

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.

None yet

3 participants