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

Docs: fix sibling selector descriptions #14099

Merged
merged 1 commit into from Feb 12, 2021
Merged

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Per the esquery documentation, ~ is following (but not necessarily adjacent) sibling, + is adjacent sibling:

  • following sibling: node ~ sibling
  • adjacent sibling: node + adjacent

Our selectors documentation has it the other way around:

  • following sibling: ArrayExpression > Literal + SpreadElement
  • adjacent sibling: VariableDeclaration ~ VariableDeclaration

This demo shows that + is adjacent, while ~ doesn't have to be adjacent.

What changes did you make? (Give an overview)

Fixed selectors.md

Is there anything you'd like reviewers to focus on?

@mdjermanovic mdjermanovic added documentation Relates to ESLint's documentation core Relates to ESLint's core APIs and features labels Feb 12, 2021
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. This is intended to match the CSS selectors. https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator

@mdjermanovic mdjermanovic merged commit f4ac3b0 into master Feb 12, 2021
@mdjermanovic mdjermanovic deleted the docs-selectors-sibling branch February 12, 2021 21:26
This was referenced Mar 5, 2021
This was referenced Mar 17, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Aug 12, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants