Skip to content

getRuleInfo not working #106

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

Closed
fisker opened this issue Apr 9, 2021 · 2 comments · Fixed by #107
Closed

getRuleInfo not working #106

fisker opened this issue Apr 9, 2021 · 2 comments · Fixed by #107

Comments

@fisker
Copy link
Contributor

fisker commented Apr 9, 2021

getRuleInfo seems not working if rule write in this way

'use strict';

const create = () => {};

module.exports = {create};

See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/e7e25b82526e42970043c39a512cbdfb889b7cb7/rules/better-regex.js#L107

I dig a little bit, this line , scopeManager.acquire(node) is null, so it will use globalScope. If I change to scopeManager.globalScope.childScopes[0] it will work.

@aladdin-add
Copy link
Contributor

PRs are welcome! 😄

@aladdin-add
Copy link
Contributor

released in [email protected]

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 a pull request may close this issue.

2 participants