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

require-array-join-separator doesn't work with optional chaining #1568

Closed
WiseBird opened this issue Nov 1, 2021 · 2 comments · Fixed by #1569
Closed

require-array-join-separator doesn't work with optional chaining #1568

WiseBird opened this issue Nov 1, 2021 · 2 comments · Fixed by #1569

Comments

@WiseBird
Copy link

WiseBird commented Nov 1, 2021

The rule doesn't work if join method is called with optional chaining

Rule: require-array-join-separator

        const array: string[] = ['1', '2', '3'];
        console.log(array.join());  // error
        console.log(array?.join()); // no error
@WiseBird WiseBird added the bug label Nov 1, 2021
@WiseBird WiseBird changed the title require-array-join-separator doesn't work optional chaining require-array-join-separator doesn't work with optional chaining Nov 1, 2021
@fisker fisker added enhancement and removed bug labels Nov 2, 2021
@fisker
Copy link
Collaborator

fisker commented Nov 2, 2021

I guess it's fine to check optional members in this rule.

@WiseBird
Copy link
Author

WiseBird commented Nov 3, 2021

Thank you

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

Successfully merging a pull request may close this issue.

2 participants