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

[Fix] destructuring-assignment: fix a false prositive for local prop named context in SFC #2929

Merged
merged 1 commit into from Feb 19, 2021

Conversation

SyMind
Copy link
Contributor

@SyMind SyMind commented Feb 19, 2021

Fixes #2911.

Related pull request: #2912

hm, does eslint itself not have utilities for determining the relationship to function params?

I adjusted my code. createSFCParams collect the props and context info in SFC.

function handleStatelessComponent(node) {
      const params = evalParams(node.params);

      const SFCComponent = components.get(context.getScope(node).block);
      if (!SFCComponent) {
        return;
      }
      sfcParams.push(params);

      // ......
}

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

made a few tweaks, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Local prop named context erroneously handled as this.context
2 participants