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

punctuation.accessor.optional-chain scope incorrect after accessing path with square brackets #207

Open
MauricioAndrades opened this issue Feb 6, 2019 · 2 comments
Labels

Comments

@MauricioAndrades
Copy link

I hate asking for these updates (Wish I knew how to do this myself so I could contribute) but would it be possible to update this?

Screenshot shows the scope that get's set incorrectly.

 if (typeof onFocus === "function") {
        onFocus(event);
 }

the scope of the if statement is
source.js meta.declaration.variable.js.fjsx15 meta.function.js.fjsx15 meta.block.js.fjsx15 meta.conditional.js.fjsx15 meta.group.js.fjsx15 meta.object-literal.js.fjsx15 meta.block.js.fjsx15 meta.function-call.js.fjsx15 variable.function.js.fjsx15

without optional chain bracket acces it's
source.js meta.declaration.variable.js.fjsx15 meta.function.js.fjsx15 meta.block.js.fjsx15 meta.conditional.js.fjsx15 keyword.control.conditional.js.fjsx15

const handleFocus = (event) => {
    const {validation, validationKey, onFocus} = this.props;
    if (validation?.fields?.[validationKey]) {
        validation.fields[validationKey].hasBeenFocused = true;
    }
    if (typeof onFocus === "function") {
        onFocus(event);
    }
};

image

@borela borela added the bug label Feb 7, 2019
@borela
Copy link
Owner

borela commented Feb 7, 2019

@MauricioAndrades
Copy link
Author

You're the best. Thank you 👍

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

No branches or pull requests

2 participants