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

Check that the node has a parent before matching a 'child' selector #138

Merged
merged 3 commits into from
Feb 16, 2023
Merged

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Feb 16, 2023

The child selector can try to match the left subselector to an undefined node when the right subselector matches to a top-level (i.e. parentless) node.

This pull request addresses that issue and adds a regression test.

This fixes the crash from issue #135 on my setup when running ESLint with eslint-config-standard, as well as with the @typescript-eslint/require-await rule enabled. It might still be a good idea to consider merging #136 or #137 as well.

The child selector can try to match the left subselector to an undefined node when the right subselector matches to a top-level (i.e. parentless) node.
@jviide jviide changed the title Add a test for issue #135 Check that the node has a parent before matching a 'child' selector Feb 16, 2023
@michaelficarra michaelficarra linked an issue Feb 16, 2023 that may be closed by this pull request
@michaelficarra
Copy link
Member

Thanks for the quick fix @jviide.

@michaelficarra michaelficarra merged commit 66df002 into estools:master Feb 16, 2023
davorpa added a commit to davorpa/omdb-search-react-app that referenced this pull request Feb 16, 2023
esquery package is a transitive dependency for us - and a broken version was released last night.

This commit fixes esquery to 1.4.2 since 1.4.1 is buggy

See: estools/esquery#135
Patched by: estools/esquery#138
@jviide jviide deleted the add-test branch February 16, 2023 14:17
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.

eslint crash when upgrading to 1.4.1
3 participants