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

Conversation

@malsf21
Copy link
Member

@malsf21 malsf21 commented Jun 20, 2020

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!

malsf21 added 4 commits Jun 19, 2020
these tests aren't failing properly, am I missing something?
this has the same functionality as live
@malsf21
Copy link
Member Author

@malsf21 malsf21 commented Jun 20, 2020

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

@m-allanson
Copy link
Member

@m-allanson m-allanson commented Jun 20, 2020

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

Copy link
Member

@jeddy3 jeddy3 left a comment

@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>
@malsf21
Copy link
Member Author

@malsf21 malsf21 commented Jun 20, 2020

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

@malsf21 malsf21 requested a review from jeddy3 Jun 20, 2020
Copy link
Member

@jeddy3 jeddy3 left a comment

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>
@malsf21
Copy link
Member Author

@malsf21 malsf21 commented Jun 20, 2020

Sounds good, updated!

@jeddy3
jeddy3 approved these changes Jun 20, 2020
Copy link
Member

@jeddy3 jeddy3 left a comment

Excellent, thank you.

Copy link
Member

@m-allanson m-allanson left a comment

LGTM, thank you 👍

@m-allanson m-allanson merged commit 1687198 into stylelint:master Jun 22, 2020
8 checks passed
8 checks passed
Lint on Node.js 12 and ubuntu-latest
Details
Test on Node.js 10 and ubuntu-latest
Details
Test on Node.js 10 and windows-latest
Details
Test on Node.js 10 and macos-latest
Details
Test on Node.js 12 and windows-latest
Details
Test on Node.js 12 and macos-latest
Details
Coverage on Node.js 12 and ubuntu-latest
Details
coverage/coveralls Coverage increased (+0.002%) to 96.616%
Details
@m-allanson
Copy link
Member

@m-allanson m-allanson commented Jun 22, 2020

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
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.