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

Add ignoreContextFunctionalPseudoClasses to selector-max-id #4835

Merged
merged 7 commits into from Jun 22, 2020
Merged

Add ignoreContextFunctionalPseudoClasses to selector-max-id #4835

merged 7 commits into from Jun 22, 2020

Conversation

mattxwang
Copy link
Member

Hi there,

This PR implements an option requested in #4619, the verbose ignoreContextFunctionalPseudoClasses to selector-max-id. In addition to modifying the rule, it also introduces a set of simple test cases (only testing on :not, :has, and :matches currently), and adds documentation to explain the usage of the rule.

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

Closes #4619.

Is there anything in the PR that needs further explanation?

As mentioned in the issue discussion, it looks like stylelint/lib/utils/isLogicalCombination.js needs to be updated to support more pseudo-classes, such as :is and :where (and possibly :nth-child); will follow up on this!

@mattxwang
Copy link
Member Author

Looks like the coveralls code coverage testing is failing on a 503.

@m-allanson
Copy link
Member

I restarted the tests and they're all 👍 this time. Must have been a temporary gremlin.

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.

@malsf21 Looking good, thanks!

I've requested some minor changes as suggestions. Mainly to align with our conventions, e.g.:

  • the minimum amount of code possible to communicate the pattern, e.g. if the rule targets selectors then use an empty rule, e.g. {}

Let's use Given: and just an array for now in the example so that it's consistent with the READMEs of the other rules. There's an issue (#4808) to update these across the board to use the full config in the examples.

lib/rules/selector-max-id/README.md Outdated Show resolved Hide resolved
lib/rules/selector-max-id/README.md Outdated Show resolved Hide resolved
lib/rules/selector-max-id/README.md Outdated Show resolved Hide resolved
lib/rules/selector-max-id/README.md Outdated Show resolved Hide resolved
lib/rules/selector-max-id/__tests__/index.js Outdated Show resolved Hide resolved
lib/rules/selector-max-id/__tests__/index.js Outdated Show resolved Hide resolved
lib/rules/selector-max-id/__tests__/index.js Outdated Show resolved Hide resolved
Mostly focused on conciseness

Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@mattxwang
Copy link
Member Author

Great, thank you for the feedback; batch-committed everything in the code review!

@mattxwang mattxwang requested a review from jeddy3 June 20, 2020 14:36
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.

Thanks for making the changes.

One last suggestion, then LGTM.

lib/rules/selector-max-id/README.md Outdated Show resolved Hide resolved
Consistency w/ other READMEs (will be changed later)

Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@mattxwang
Copy link
Member Author

Sounds good, updated!

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.

Excellent, thank you.

Copy link
Member

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

LGTM, thank you 👍

@m-allanson m-allanson merged commit 1687198 into stylelint:master Jun 22, 2020
@m-allanson
Copy link
Member

Updated changelog:

  • Added: ignoreContextFunctionalPseudoClasses to selector-max-id (#4835)

m-allanson added a commit that referenced this pull request Jun 22, 2020
# By Mike Allanson (2) and others
* master:
  Fix changelog formatting
  A small refactor (#4837)
  Update CHANGELOG.md
  Add ignoreContextFunctionalPseudoClasses to selector-max-id (#4835)
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.

Add ignoreContextFunctionalPseudoClasses: [] to selector-max-id
3 participants