Skip to content

Fix: Rule can't find reference of create function #107

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

Merged
merged 4 commits into from
Apr 15, 2021

Conversation

fisker
Copy link
Contributor

@fisker fisker commented Apr 9, 2021

Turns out if create is a reference, the global scope don't have the reference not only in nodejsScope, also broken if sourceType is set to 'module'.

To find the correct reference, I'm searching all childScopes, I hope it's fine to do this.

Fixes #106

@fisker fisker changed the title Fix: Rule can't find create reference Fix: Rule can't find reference of create function Apr 9, 2021
@fisker fisker changed the title Fix: Rule can't find reference of create function Fix: Rule can't find reference of create function Apr 9, 2021
@fisker
Copy link
Contributor Author

fisker commented Apr 9, 2021

@aladdin-add No CI running?

`, { ecmaVersion: 6 });
const expected = {
create: { type: 'Identifier' },
meta: { type: 'Identifier' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should still break rules like this, It should return the reference. But I'm not going to work on it in this PR.

@aladdin-add
Copy link
Contributor

ci was not working somehow ╮( ̄▽ ̄)╭, we are considering switching to gh actions. refs #104

@aladdin-add aladdin-add self-requested a review April 9, 2021 08:08
Copy link
Contributor

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aladdin-add aladdin-add merged commit eb501fc into eslint-community:master Apr 15, 2021
@fisker fisker deleted the get-rule-info branch April 15, 2021 07:40
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.

getRuleInfo not working
3 participants