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

Do not warn about nesting css selectors when firefoxStrictMinVersion is >= 117 #5164

Merged
merged 11 commits into from
Feb 9, 2024

Conversation

schmop
Copy link
Contributor

@schmop schmop commented Jan 12, 2024

Fixes #5102

Since Firefox Version 117 CSS selector nesting is supported.
This is not reflected in the rules/css/invalidNestingSelectors.js of the addons-linter.
In this changeset I introduced a check against the firefoxMinStrictVersion, or strict_min_version which is specified in the manifest.json.

  • This PR relates to an existing open issue and there are no existing PRs open for the same issue.
  • Add Fixes #ISSUENUM at the top of your PR.
  • Add a description of the changes introduced in this PR.
  • The change has been successfully run locally.

┆Issue is synchronized with this Jira Task

@schmop schmop force-pushed the css-nesting-selectors-min-version branch from a621607 to cec0430 Compare January 12, 2024 23:13
…is >= 117

Co-authored-by: JimKnoxx <imknoxx@knoxx.media>
@schmop schmop force-pushed the css-nesting-selectors-min-version branch from cec0430 to 23420b2 Compare January 12, 2024 23:56
Copy link

codecov bot commented Jan 13, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b893bb0) 98.73% compared to head (4c5a890) 98.74%.
Report is 29 commits behind head on master.

Files Patch % Lines
src/rules/css/invalidNesting.js 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5164   +/-   ##
=======================================
  Coverage   98.73%   98.74%           
=======================================
  Files          54       54           
  Lines        2932     2937    +5     
  Branches      893      896    +3     
=======================================
+ Hits         2895     2900    +5     
  Misses         37       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willdurand willdurand self-requested a review January 15, 2024 14:26
Copy link
Member

@willdurand willdurand left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR. Here is some feedback, thanks!

* @property {string} version
* @property {string} firefoxMinVersion
* @property {Set<string>} experimentApiPaths
*/
Copy link
Member

Choose a reason for hiding this comment

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

Can that be either omitted or moved near getMetadata()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it down. I added JSDoc, because it helped me a great deal understand what structure I can rely on. I thought it might help future devs aswell, that do not know the internals yet.

Copy link
Member

Choose a reason for hiding this comment

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

I am not against but I think I'd rather see that added in a different PR.

* @param {string|Buffer|import('stream').Readable} contents
* @param {string} filename
* @param {ScannerOptions} options
*/
Copy link
Member

Choose a reason for hiding this comment

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

That kinda looks like typescript stuff, is this really needed as part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These kind of JSDoc comments are the compromise of having types without using typescript. It helps documenting interfaces, allowing IDEs with code suggestions and helping new devs to faster move around foreign code. I typed parts where I struggled with the given interfaces and needed to dig deeper and documented it right away, so others don't have to. Is this kind of type-documenting style unwelcome in this repository? I can definitely just remove it.

Copy link
Member

Choose a reason for hiding this comment

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

see other comment

Copy link
Member

@willdurand willdurand left a comment

Choose a reason for hiding this comment

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

Thanks. I requested some more changes but this is looking great.

@willdurand willdurand self-assigned this Feb 8, 2024
Co-authored-by: William Durand <will+git@drnd.me>
Copy link
Member

@willdurand willdurand left a comment

Choose a reason for hiding this comment

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

Excellent, thanks!

@willdurand willdurand merged commit 5508042 into mozilla:master Feb 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow CSS nesting
2 participants