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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搸 Implment no-duplicate-selectors #2514

Open
Tracked by #2511
togami2864 opened this issue Apr 18, 2024 · 4 comments 路 May be fixed by #2660
Open
Tracked by #2511

馃搸 Implment no-duplicate-selectors #2514

togami2864 opened this issue Apr 18, 2024 · 4 comments 路 May be fixed by #2660
Assignees
Labels
A-Analyzer Area: analyzer A-Linter Area: linter L-CSS Language: CSS S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@togami2864
Copy link
Contributor

togami2864 commented Apr 18, 2024

Description

Implmenet no-duplicate-selectors

Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.

@togami2864 togami2864 changed the title no-duplicate-selectors 馃搸 Implment no-duplicate-selectors Apr 18, 2024
@togami2864 togami2864 added S-Help-wanted Status: you're familiar with the code base and want to help the project A-Linter Area: linter L-CSS Language: CSS A-Analyzer Area: analyzer labels Apr 18, 2024
@abidjappie
Copy link
Contributor

Hi, I would like to contribute to this issue! 馃檱

@abidjappie
Copy link
Contributor

Still working on this one, will do a status update as soon as I can 馃檱

  • Wrote a visitor to return the Selector groupings in a sheet.

Since we need to compare the all the selectors in the sheet against each other, as well as being able to compare whether selectors are equivalent I need to do some things to "resolve" the selector.

@abidjappie
Copy link
Contributor

abidjappie commented Apr 30, 2024

I created a draft PR (#2660)

Working on trying to get the selector resolver to properly resolve the & case, and then to work with AtRule.
I think the implementation is going to end up much larger than I anticipated, mainly to resolve selectors so they can be compared for equivalents.

I want to eventually remove the Visitor but right now it's the easiest way to get the nodes of interest, my other option is to get the entire list and handle it (seems like a lot of traversing for the run).

If there is some way to persist State between multiple runs that I can use to track the resolved selectors then it may be easier to compare by just fetching the upper level CSS rules. 馃

@abidjappie abidjappie linked a pull request May 7, 2024 that will close this issue
@abidjappie
Copy link
Contributor

Update: working on another solution that does not rely on recursion (see the PR for context). Will attempt to reduce the scope covered by it so it's easier to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analyzer Area: analyzer A-Linter Area: linter L-CSS Language: CSS S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants